Skip to content

Commit 1075c15

Browse files
committed
typeStmt now supports #If blocks
1 parent e5ea2dc commit 1075c15

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

server/src/antlr/vba.g4

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,19 @@ stopStmt: STOP;
460460
timeStmt: TIME WS? EQ WS? valueStmt;
461461

462462
typeStmt:
463-
(visibility WS)? TYPE WS ambiguousIdentifier endOfStatement typeStmt_Element* END_TYPE;
463+
(visibility WS)? TYPE WS ambiguousIdentifier endOfStatement (typeStmt_Element|macroTypeIfThenElseStmt)* END_TYPE;
464+
465+
macroTypeIfThenElseStmt:
466+
macroTypeIfBlockStmt macroTypeElseIfBlockStmt* macroTypeElseBlockStmt? MACRO_END_IF endOfStatement;
467+
468+
macroTypeIfBlockStmt:
469+
MACRO_IF WS? ifConditionStmt WS THEN endOfStatement typeStmt_Element*;
470+
471+
macroTypeElseIfBlockStmt:
472+
MACRO_ELSEIF WS? ifConditionStmt WS THEN endOfStatement typeStmt_Element*;
473+
474+
macroTypeElseBlockStmt:
475+
MACRO_ELSE endOfStatement typeStmt_Element*;
464476

465477
typeStmt_Element:
466478
ambiguousIdentifier (WS? LPAREN (WS? subscripts)? WS? RPAREN)? (

0 commit comments

Comments
 (0)