Skip to content

Commit 72088a4

Browse files
committed
Simplify extension declaration a bit
Duplicates one of the changes from antlr#4632
1 parent d9b8d72 commit 72088a4

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

protobuf/protobuf2/Protobuf2.g4

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ type_
132132
// Extensions
133133

134134
extensions
135-
: EXTENSIONS ranges (LB (verificationDef | declarationsDef) RB)? SEMI
135+
: EXTENSIONS ranges (LB (verificationDef | declarations) RB)? SEMI
136136
;
137137

138138
verificationDef
@@ -144,16 +144,12 @@ verification
144144
| UNVERIFIED_LIT
145145
;
146146

147-
declarationsDef
148-
: declarationDef (COMMA declarationDef)*
149-
;
150-
151-
declarationDef
152-
: DECLARATION EQ LC (declaration (declaration)*)? RC
147+
declarations
148+
: declaration (COMMA declaration)*
153149
;
154150

155151
declaration
156-
: fieldName COLON constant (COMMA)?
152+
: DECLARATION EQ blockLit
157153
;
158154

159155
// Reserved

0 commit comments

Comments
 (0)