Add definition for compound assignment operators#1144
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
|
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.