-
Notifications
You must be signed in to change notification settings - Fork 442
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
[#4656] Revert PR #3633 so that mux expressions will be constant folded #4660
Conversation
Looks like this is supceded by #4657, so this can be closed? |
@ChrisDodd It is an alternate approach to #4657. I plan to close one after the other is merged. |
ec4d304
to
c2ac874
Compare
As mentioned in #4657, I'm actually preferring this PR at this point. |
} | ||
apply { | ||
switch(baz()) { | ||
1 + 2 == 3 ? 1 : 2 : { foo(); } |
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.
I am just surprised this is not syntactically ambiguous, the 2 :
look quite weird :-). (This is not an issue with the PR/test, I'm just surprised the grammar allows it).
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.
A single token of lookahead in Bison is apparently enough for it to figure it out, especially from the context that this is inside of a switch
statement.
p4lang/p4-spec#1281 determines whether we may merge this particular PR, too. |
OK, so should this one be closed now? |
Sure, it will need to be rebased even if the outcome of p4lang/p4-spec#1281 is to remove the error. |
Reverts 4a74084, as discussed as an alternate fix for #4656 in #4657.