-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add definition for compound assignment operators #1144
base: main
Are you sure you want to change the base?
Conversation
07c5b42
to
440d1c9
Compare
Did we intentionally forget about |
440d1c9
to
5ab618a
Compare
Thank you Vladimir for pointing this out! I have revised the pull request to include saturating arithmetic operations. |
5ab618a
to
680a6e2
Compare
Are the "+=" operators two tokens or just one? The earlier version only needs parser changes while the later needs both lexer and parser changes. |
Not only in the appendix. |
It won't because statements are defined as: And lvalue does not have any of those tokens in it. |
9af9ac5
to
7fbc33b
Compare
7fbc33b
to
6c58440
Compare
This patch adds definition for compound-assignment operators to the P4 language specification. These operators provide a shorter syntax for assigning the result of an arithmetic or bitwise operator. The proposed definition of compound assignment operators is similar the C99 specification. https://en.cppreference.com/w/c/language/operator_assignment Signed-off-by: Radostin Stoyanov <radostin.stoyanov@eng.ox.ac.uk>
6c58440
to
9d57e9f
Compare
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.
LGTM
In the interest of tidying up the set of active issues on the P4 specification repository, I'm marking this as "stalled" and closing it. Of course, we can always re-open it in the future if there is interest in resurrecting it. |
Reopening due to new interest in implementing this in p4c. |
This pull request adds definition for compound-assignment operators to the P4 language specification. These operators provide a shorter syntax for assigning the result of an arithmetic or bitwise operator. The proposed definition of compound assignment operators is similar the C99 specification.