Skip to content

Commit 0c12e0a

Browse files
authored
Allow custom types with underscore and numbers (#88)
1 parent b024e16 commit 0c12e0a

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

syntaxes/tests/vba/types.bas

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,23 @@ Dim v as Variant
3232
Dim spam as MyVarType
3333
' ^^^^^^^^^ support.type
3434

35-
Sub eggs(p As ParamType) as RetType
36-
' ^^^^^^^^^ support.type
37-
' ^^^^^^^^ support.type
35+
Dim rm As REMOTE_MEMORY2
36+
' ^^^^^^^^^^^^^^ support.type
37+
38+
Function eggs(p As ParamType) as RetType
39+
' ^^^^^^^^^ support.type
40+
' ^^^^^^^ support.type
41+
End Sub
42+
43+
Sub InitRemoteMemory(ByRef rm As REMOTE_MEMORY2)
44+
' ^^^^^^^^^^^^^^ support.type
3845
End Sub
3946

4047
Dim myConverter As DateConverter
4148
' ^^^^ - support.type.builtin.vba
4249

50+
Dim se As String_Extension2
51+
' ^^^^^^ - support.type.builtin.vba
52+
4353
ConvertAs myVar, myConverter
4454
' ^^^^^ - support.type

syntaxes/vba.tmGrammar.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ repository:
8282
patterns:
8383
- name: support.type.builtin.vba
8484
match: (?i)\b(Any|Byte|Boolean|Currency|Collection|Date|Double|Integer|Long(Long|Ptr)?|Object|Single|String|Variant)\b
85-
- match: (?i)(?<= As )([a-zA-Z]+)
85+
- match: (?i)(?<= As )([a-zA-Z][a-zA-Z0-9_]*)
8686
captures:
8787
1:
8888
name: support.type

0 commit comments

Comments
 (0)