-
Notifications
You must be signed in to change notification settings - Fork 2
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
Handle block comments /* */ #81
Conversation
…, added make target showing env vars to setup logger in tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is indeed not fun.
At least, you seem to have added enough test to handle it
{"5 + 5 + 5 + 5 - 10 /* some block comment */", 10}, | ||
/* These don't work, we need to make comment a identity operator or prune them entirely from the AST. */ | ||
// {"5 + /* block comment in middle of expression */ 2", 7}, | ||
// {" - /* inline of prefix */ 5", -5}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ccoVeille also this ^ ie the block/inline comments currently do break expressions, basically act as a ; or \n and making them not do that requires more surgery (like 2 passes, one for -format/pretty print and one for nuking the comments... which seems not ideal)
The difficulty is in the -format output to keep the block comment where they were (same line or new line etc)
This was harder to get right than... I wanted
fixes #14