Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reject break statements outside loops #70

Closed
fstirlitz opened this issue Aug 18, 2019 · 2 comments
Closed

Reject break statements outside loops #70

fstirlitz opened this issue Aug 18, 2019 · 2 comments
Assignees
Labels
incorrect parsing Valid Lua code fails to parse, is parsed incorrectly, or invalid Lua code is accepted
Milestone

Comments

@fstirlitz
Copy link
Owner

There is a disabled expected-failure testcase in the test/scaffolding/functions file:

function a(p) break end                 -- FAIL

Currently, it parses successfully; although it matches the basic recursive grammar, it semantically makes no sense and is rejected by all Lua implementations at compilation stage (although apparently only after the entire body is parsed). It would probably make sense to reject it here too.

@fstirlitz fstirlitz added the incorrect parsing Valid Lua code fails to parse, is parsed incorrectly, or invalid Lua code is accepted label Aug 18, 2019
@fstirlitz fstirlitz self-assigned this Aug 21, 2019
@fstirlitz
Copy link
Owner Author

I've got some WIP code which fixes this.

@fstirlitz
Copy link
Owner Author

Fixed in 680238c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incorrect parsing Valid Lua code fails to parse, is parsed incorrectly, or invalid Lua code is accepted
Projects
None yet
Development

No branches or pull requests

1 participant