-
Notifications
You must be signed in to change notification settings - Fork 93
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
Yet more misparsing: invalid parentheses in call statements and assignments #24
Comments
Thanks again felix! Unfortunately I won't have time to look into this for quite some time. I'm leaving for a 6 month trip around the middle east and won't have access to a development machine during this time. If you however have the time and can figure out a fix feel free to commit it. I've added you as a collaborator to the project as you are more than capable of managing it :) I trust your judgment so feel free to commit whatever else you think could help the project. |
unfortunately it's necessary to peek the outputted AST to accomplish this, which may be unreliable. the same kludge is already used in isCallExpression() the "caller can supply their own AST construction methods" feature probably needs to go. either that or some parsing functions need to return two values: one for the constructed AST and some for internal use - that would be rather wasteful. benchmarks docs luaparse.js SciTE.properties testem.yml bin examples Makefile scripts bower.json Gruntfile.js node_modules static_test component.json index.js package.json static_test.lua dist LICENSE README.md test
unfortunately it's necessary to peek the outputted AST to accomplish this, which may be unreliable. the same kludge is already used in isCallExpression() the "caller can supply their own AST construction methods" feature probably needs to go. either that or some parsing functions need to return two values: one for the constructed AST and some for internal use - that would be rather wasteful.
Should also add: (a());
(a"");
(a{}); I've got some WIP code which should fix this once and for all. |
Finally definitively fixed in 6c00a3a. The particular parsing mechanics (and the resulting error messages) may still change in the future, but at least all test cases fail as expected now. |
Each of the lines that follow is a syntax error, yet luaparse does not recognise these as such:
Note, however, that the following are not (syntactical, at least) errors:
Relevant portions of the Lua 5.2 manual (essentially identical in Lua 5.0 and 5.1, and to 5.3-work2): §3.2 "Variables", §3.3.3 "Assignment", §9 "The Complete Syntax of Lua"
The text was updated successfully, but these errors were encountered: