Skip to content

Commit

Permalink
Remove lookbehind for functions scope (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
DecimalTurn authored Nov 26, 2024
1 parent 8da3873 commit 926fe8b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion syntaxes/tests/vba/other.bas
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Private WithEvents app As Outlook.Application
Event LogonCompleted(UserName as String)
' <----- keyword.other.vba

Sub Logon
Sub Logon()
RaiseEvent LogonCompleted ("AntoineJan")
' ^^^^^^^^^^ keyword.other.vba
End Sub
4 changes: 4 additions & 0 deletions syntaxes/tests/vba/procedure.bas
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ End Function
Call mSub()
' <---- keyword.other.vba
' ^^^^ entity.name.function.vba

Call SubWithNoArgs
' <---- keyword.other.vba
' ^^^^^^^^^^^^^ entity.name.function.vba
13 changes: 10 additions & 3 deletions syntaxes/vba.yaml-tmlanguage
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,16 @@ repository:
match: ^.*

functions:
name: entity.name.function.vba
match: (?i:\b(?:(?<=(Call|Function|Sub) ))([a-zA-Z][a-zA-Z0-9_]*)\b)(?=\(\)?)

name: testing.vba
begin: (?i:\b(Call|Function|Sub) )
beginCaptures:
1:
name: keyword.other.vba
patterns:
- name: entity.name.function.vba
match: (?i:\b([a-zA-Z][a-zA-Z0-9_]*)\b)
end: \(|(?=\n)

keywords:
patterns:
- name: keyword.conditional.vba
Expand Down

0 comments on commit 926fe8b

Please sign in to comment.