Skip to content

Commit 376bc65

Browse files
author
mbudiu-vmw
committed
Address comments
1 parent 65b769a commit 376bc65

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

p4-16/spec/P4-16-spec.mdk

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2859,7 +2859,6 @@ expression
28592859
| expression '[' expression ':' expression ']'
28602860
| '{' expressionList '}'
28612861
| '{' kvList '}'
2862-
| typeName '{' kvList '}'
28632862
| '(' expression ')'
28642863
| '!' expression
28652864
| '~' expression
@@ -3743,20 +3742,20 @@ field access, written using dot (".") notation---e.g., `s.field`. If
37433742
copying `struct`s using assignment when the source and target of the
37443743
assignment have the same type. Finally, `struct`s can be initialized
37453744
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
37483747
fields of the structure.
37493748

37503749
Two structs can be compared for equality (==) or inequality (!=) only
37513750
if they have the same type and all of their fields can be recursively
37523751
compared for equality. Two structures are equal if and only if all
37533752
their corresponding fields are equal.
37543753

3755-
## Structure initializers { #sec-structure-expressions}
3754+
## Structure initializers { #sec-structure-initializers }
37563755

37573756
Structures can be initialized using structure initializers, which
37583757
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
37603759
side of an initialization of a variable with a struct type.
37613760

37623761
~ Begin P4Grammar
@@ -3775,7 +3774,7 @@ kvPair
37753774
~ End P4Grammar
37763775

37773776
The following example shows a structure initialized using a
3778-
structure-valued expression:
3777+
structure initializer:
37793778

37803779
~ Begin P4Example
37813780
struct S {
@@ -3822,7 +3821,7 @@ valid:
38223821

38233822
Similar to a `struct`, a header object can be initialized with a list
38243823
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
38263825
expression [#sec-ops-on-structs]. When initialized the header
38273826
automatically becomes valid:
38283827

0 commit comments

Comments
 (0)