@@ -2859,7 +2859,6 @@ expression
2859
2859
| expression '[' expression ':' expression ']'
2860
2860
| '{' expressionList '}'
2861
2861
| '{' kvList '}'
2862
- | typeName '{' kvList '}'
2863
2862
| '(' expression ')'
2864
2863
| '!' expression
2865
2864
| '~' expression
@@ -3743,20 +3742,20 @@ field access, written using dot (".") notation---e.g., `s.field`. If
3743
3742
copying `struct`s using assignment when the source and target of the
3744
3743
assignment have the same type. Finally, `struct`s can be initialized
3745
3744
with a list expression, as discussed in Section [#sec-list-exprs], or
3746
- with a structure-valued expression , as described in
3747
- [#sec-structure-expressions ]. Both these cases must initialize all
3745
+ with a structure initializer , as described in
3746
+ [#sec-structure-initializers ]. Both these cases must initialize all
3748
3747
fields of the structure.
3749
3748
3750
3749
Two structs can be compared for equality (==) or inequality (!=) only
3751
3750
if they have the same type and all of their fields can be recursively
3752
3751
compared for equality. Two structures are equal if and only if all
3753
3752
their corresponding fields are equal.
3754
3753
3755
- ## Structure initializers { #sec-structure-expressions }
3754
+ ## Structure initializers { #sec-structure-initializers }
3756
3755
3757
3756
Structures can be initialized using structure initializers, which
3758
3757
specify explicitly the intialized fields. A structure initializer
3759
- expression evaluates to an struct; it can be used on the right-hand
3758
+ expression evaluates to a struct; it can be used on the right-hand
3760
3759
side of an initialization of a variable with a struct type.
3761
3760
3762
3761
~ Begin P4Grammar
@@ -3775,7 +3774,7 @@ kvPair
3775
3774
~ End P4Grammar
3776
3775
3777
3776
The following example shows a structure initialized using a
3778
- structure-valued expression :
3777
+ structure initializer :
3779
3778
3780
3779
~ Begin P4Example
3781
3780
struct S {
@@ -3822,7 +3821,7 @@ valid:
3822
3821
3823
3822
Similar to a `struct`, a header object can be initialized with a list
3824
3823
expression [#sec-list-exprs] --- the list fields are assigned to the
3825
- header fields in the order they appear, or with a struct initializer
3824
+ header fields in the order they appear --- or with a structure initializer
3826
3825
expression [#sec-ops-on-structs]. When initialized the header
3827
3826
automatically becomes valid:
3828
3827
0 commit comments