Skip to content

Commit

Permalink
Issue p4lang#1273
Browse files Browse the repository at this point in the history
Added the definition allowing parentheses around lvalues to the grammar,
similar to what was done in p4lang/p4c#4530.

In addition to that performed a minor cleanup, replacing the (copied)
grammar code with the proper INCLUDE.
  • Loading branch information
vgurevich authored and jnfoster committed Jun 3, 2024
1 parent fa1e983 commit e6f051e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 1 addition & 6 deletions p4-16/spec/P4-16-spec.mdk
Original file line number Diff line number Diff line change
Expand Up @@ -1457,12 +1457,7 @@ following expressions are legal l-values:
~ Begin P4Grammar
[INCLUDE=grammar.mdk:prefixedNonTypeName]

lvalue
: prefixedNonTypeName
| lvalue "." member
| lvalue "[" expression "]"
| lvalue "[" expression ":" expression "]"
;
[INCLUDE=grammar.mdk:lvalue]
~ End P4Grammar

- Identifiers of a base or derived type.
Expand Down
1 change: 1 addition & 0 deletions p4-16/spec/grammar.mdk
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,7 @@ lvalue
| lvalue "." member
| lvalue "[" expression "]"
| lvalue "[" expression ":" expression "]"
| "(" lvalue ")"
;
// END:lvalue

Expand Down

0 comments on commit e6f051e

Please sign in to comment.