Skip to content

Commit a2a0c56

Browse files
committed
Bug fixes
1 parent bcd8580 commit a2a0c56

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

server/src/antlr/vbafmt.g4

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,18 @@ methodClose
106106
: ws? END ws (SUB | FUNCTION | PROPERTY)
107107
;
108108

109+
withBlockOpen
110+
: ws? WITH ws expression+ endOfStatement
111+
;
112+
113+
withBlockClose
114+
: ws? END ws WITH endOfStatement
115+
;
116+
109117
withBlock
110-
: ws? WITH ws expression endOfStatement
118+
: withBlockOpen
111119
block?
112-
ws? END ws WITH endOfStatement
120+
withBlockClose
113121
;
114122

115123
block
@@ -164,7 +172,7 @@ forBlockClose
164172
;
165173

166174
forBlock
167-
: ws? forBlockOpen
175+
: forBlockOpen
168176
block?
169177
forBlockClose
170178
;
@@ -213,11 +221,12 @@ caseDefaultStatement
213221
;
214222

215223
caseBlock
216-
: ((caseStatement | caseDefaultStatement) block?)+
224+
: ((caseStatement | caseDefaultStatement) block)+
217225
;
218226

219227
selectCaseBlock
220228
: selectCaseOpen
229+
documentElement*
221230
caseBlock?
222231
selectCaseClose
223232
;
@@ -257,7 +266,6 @@ keywordComponent
257266
| GLOBAL
258267
| IF
259268
| IS
260-
| NEXT
261269
| PRIVATE
262270
| PROPERTY
263271
| PUBLIC

0 commit comments

Comments
 (0)