-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Parse expressions in preprocessor #if statement #29
Parse expressions in preprocessor #if statement #29
Conversation
@maxbrunsfeld ping ? |
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.
Is this going to cover all possible #if
arguments?
I have been reluctant to try to model the preprocessor too precisely, because I know that it is an entirely different language in some ways. I'm wondering if for most purposes it is better to just parse preproc_arg
values as C using a separate (best-effort) pass. That is what Atom currently does for macro definitions, maybe we could expand it to include all preproc_arg
values.
I might be open to this, if it is really worth the complexity that it adds. What are your thoughts on the tradeoffs here. What are you using this functionality for?
I'd say yes, I followed the spec here:
I did it to try to have a "complete" parser but not sure if it's useful or not (I've no use case right now). |
* Hide the wrapper rules * Alias the rulres to match their corresponding expression rule * Handle line continuations as extra tokens
4d8de10
to
5ebe8c2
Compare
Ok, I think you're right: the rules for preprocessor expressions are pretty clear, so there's no reason not to parse them. I pushed up a small change to make the preprocessor expressions appear similar to normal expressions in the tree. |
No description provided.