Skip to content

Commit

Permalink
Ensure Lua's reserved identifiers also work as documented
Browse files Browse the repository at this point in the history
  • Loading branch information
Sainan committed Aug 17, 2024
1 parent 1e5adfa commit c0eb5d1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion testes/pluto/basic.pluto
Original file line number Diff line number Diff line change
Expand Up @@ -3155,9 +3155,11 @@ do
end
do -- Reserved Identifiers
local t = {
class = "key"
class = "key",
while = "another key",
}
assert(t.class == "key")
assert(t.while == "another key")

for i = 1, 10 do
if i == 5 then
Expand All @@ -3166,6 +3168,13 @@ do -- Reserved Identifiers
::continue::
end

for i = 1, 10 do
if i == 5 then
goto while
end
::while::
end

-- This should still be an error
assert(load[[return break]] == nil)
assert(load[[return while]] == nil)
Expand Down

0 comments on commit c0eb5d1

Please sign in to comment.