Skip to content

Commit

Permalink
Exclude Input inside Open statement (fixed length lookahead) (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
DecimalTurn authored Dec 1, 2023
1 parent 33305c3 commit d76a6ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion syntaxes/tests/vba/io.bas
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

Open "file" For Input As #f
' <--- keyword.io.vba
' ^^^^^ keyword.io.vba
' ^^^^^ - keyword.io.vba
Input #f myVar
' ^^^^^ keyword.io.vba
' ^^^ - keyword.io.vba

Line Input #f myLineVar
' ^^^^^^^^^^ keyword.io.vba
Expand Down
4 changes: 3 additions & 1 deletion syntaxes/vba.tmGrammar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ repository:
- name: keyword.control.vba
match: (?i:(\b(Exit (Function|Property|Sub)|As|And|By(Ref|Val)|Goto|Is|Like|Mod|Not|On Error|Optional|Or|Resume Next|Stop|Xor|Eqv|Imp|TypeOf|AddressOf)\b)|(\b(End)\b(?=\n)))
- name: keyword.io.vba
match: (?i:\b(Open|Close|(Line )?Input|Lock|Unlock|Print|Seek|Width|Get|Put|Write)\b)
match: (?i:\b(Open|Close|Line Input|Lock|Unlock|Print|Seek|Width|Get|Put|Write)\b)
- name: keyword.io.vba
match: "(?i:\\b(Input)(?= #))"
- name: keyword.other.vba
match: (?i:\b(Attribute|Call|End (Function|Property|Sub|Type|Enum)|(Const|Function|Property|Sub|Type|Enum)|Declare|PtrSafe|WithEvents|Event|RaiseEvent|Implements)\b)
- name: keyword.other.option.vba
Expand Down

0 comments on commit d76a6ea

Please sign in to comment.