-
Notifications
You must be signed in to change notification settings - Fork 48
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
--ast is missing information #177
Comments
Added function names there. Any other missing? |
Thanks. Found another one. The following shorthand also seems to lose information in the ast about the negated side: |
Done. |
Thanks, I really appreciate the changes (working on an internal project to auto-standardize the syntax and the AST tree is working great for that), another thing is that for loop representation seems to be inconsistent (when using multiple iteration arguments). For example, a typical loop on line 24 of ast.co, 'for tmp of that' portion is represented as: While a 2-argument loop on line 1277 of ast.co 'for test, i in items' gets represented as follows, which seems even more odd, since representation of i and test is inconsistent with eachother within the same statement as well: It looks like after parsing the first argument, the logic just skips to the array. |
In that case you may want to use
or directly interact with the compiler:
The tree view you're using is for quick debugging and isn't meant to show all the information. |
While I haven't examined the AST tree in enough detail to see if anything else is missing, I've noticed that function names seem to be gone from the generated ast when using --ast command. For anonymous functions this doesn't matter, since the actual name is whatever they get assigned to. For functions created using the 'function' keyword, however, this is a problem.
A quick example is to run 'bin/coco --ast src/ast.co', the only function that has a name is 'this$', which I'm guessing is an internally generated function rather than user-defined.
The text was updated successfully, but these errors were encountered: