diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-05-28 15:46:49 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-05-28 15:46:49 -0300 |
commit | b293ae0577bebaca7169cb4f041b800641d5e2c4 (patch) | |
tree | bda609d72277433bda3537ac50ed8fecf9a73898 /testes/constructs.lua | |
parent | d9f40e3f6fb61650240c47d548bee69b24b07859 (diff) | |
download | lua-b293ae0577bebaca7169cb4f041b800641d5e2c4.tar.gz lua-b293ae0577bebaca7169cb4f041b800641d5e2c4.tar.bz2 lua-b293ae0577bebaca7169cb4f041b800641d5e2c4.zip |
Details
- new error message for "attempt to assign to const variable"
- note in the manual about compatibility options
- comments
- small changes in 'read_line' and 'pushstr'
Diffstat (limited to 'testes/constructs.lua')
-rw-r--r-- | testes/constructs.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/testes/constructs.lua b/testes/constructs.lua index b91e0979..fe4db2cb 100644 --- a/testes/constructs.lua +++ b/testes/constructs.lua | |||
@@ -215,7 +215,7 @@ do -- testing constants | |||
215 | checkload(prog, "unknown attribute 'XXX'") | 215 | checkload(prog, "unknown attribute 'XXX'") |
216 | 216 | ||
217 | checkload([[local <const> xxx = 20; xxx = 10]], | 217 | checkload([[local <const> xxx = 20; xxx = 10]], |
218 | ":1: assignment to const variable 'xxx'") | 218 | ":1: attempt to assign to const variable 'xxx'") |
219 | 219 | ||
220 | checkload([[ | 220 | checkload([[ |
221 | local xx; | 221 | local xx; |
@@ -225,12 +225,12 @@ do -- testing constants | |||
225 | local abc = xx + yyy + xxx; | 225 | local abc = xx + yyy + xxx; |
226 | return function () return function () xxx = yyy end end | 226 | return function () return function () xxx = yyy end end |
227 | end | 227 | end |
228 | ]], ":6: assignment to const variable 'xxx'") | 228 | ]], ":6: attempt to assign to const variable 'xxx'") |
229 | 229 | ||
230 | checkload([[ | 230 | checkload([[ |
231 | local <toclose> x = nil | 231 | local <toclose> x = nil |
232 | x = io.open() | 232 | x = io.open() |
233 | ]], ":2: assignment to const variable 'x'") | 233 | ]], ":2: attempt to assign to const variable 'x'") |
234 | end | 234 | end |
235 | 235 | ||
236 | f = [[ | 236 | f = [[ |