Skip to content

Commit ef2e7bc

Browse files
committed
Separate name attribute to make it easier to target and add description attribute
1 parent e802a4f commit ef2e7bc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

server/src/antlr/vba.g4

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,24 @@ classModule
7676

7777
// Compare STRINGLITERAL to quoted-identifier
7878
proceduralModuleHeader
79-
: endOfLine* ATTRIBUTE WS? VB_NAME WS? EQ WS? STRINGLITERAL
79+
: endOfLine* nameAttr?
8080
;
81-
classModuleHeader: (endOfLine+ classAttr)+ WS?;
81+
classModuleHeader: (endOfLine+ (classAttr | nameAttr))* WS?;
8282

8383
// VBA Library Projects are allowed to have GoobalNamespace and creatable as true.
8484
classAttr
85-
: ATTRIBUTE WS? VB_NAME WS? EQ WS? STRINGLITERAL
85+
: ATTRIBUTE WS? VB_DESCRIPTION WS? EQ WS? STRINGLITERAL
8686
| ATTRIBUTE WS? VB_GLOBALNAMESPACE WS? EQ WS? booleanLiteralIdentifier
8787
| ATTRIBUTE WS? VB_CREATABLE WS? EQ WS? booleanLiteralIdentifier
8888
| ATTRIBUTE WS? VB_PREDECLAREDID WS? EQ WS? booleanLiteralIdentifier
8989
| ATTRIBUTE WS? VB_EXPOSED WS? EQ WS? booleanLiteralIdentifier
9090
| ATTRIBUTE WS? VB_CUSTOMIZABLE WS? EQ WS? booleanLiteralIdentifier
9191
;
92+
93+
nameAttr
94+
: ATTRIBUTE WS? VB_NAME WS? EQ WS? STRINGLITERAL
95+
;
96+
9297
//---------------------------------------------------------------------------------------
9398
// 5.1 Module Body Structure
9499
// Everything from here down is user generated code.

0 commit comments

Comments
 (0)