PlutoLang / Pluto

A superset of Lua 5.4 with a focus on general-purpose programming.
https://pluto-lang.org
MIT License
367 stars 22 forks source link

Reserved identifiers can be used too freely #924

Closed Sainan closed 1 month ago

Sainan commented 1 month ago

Pluto is only documented to lift restrictions in very specific situations[1], but it actually lifts restrictions in a lot more places, resulting in some erroneous code that would result in a parse error in Lua to run without errors or warnings in Pluto, e.g.:

function f()
    for i = 1, 10 do
        return break
    end
end
_G["break"] = 10
print(f())

[1] https://plutolang.github.io/docs/QoL%20Improvements/Reserved%20Identifiers