Skip to content

Commit d76a6ea

Browse files
authored
Exclude Input inside Open statement (fixed length lookahead) (#100)
1 parent 33305c3 commit d76a6ea

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

syntaxes/tests/vba/io.bas

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
Open "file" For Input As #f
44
' <--- keyword.io.vba
5-
' ^^^^^ keyword.io.vba
5+
' ^^^^^ - keyword.io.vba
66
Input #f myVar
77
' ^^^^^ keyword.io.vba
8+
' ^^^ - keyword.io.vba
89

910
Line Input #f myLineVar
1011
' ^^^^^^^^^^ keyword.io.vba

syntaxes/vba.tmGrammar.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ repository:
4646
- name: keyword.control.vba
4747
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)))
4848
- name: keyword.io.vba
49-
match: (?i:\b(Open|Close|(Line )?Input|Lock|Unlock|Print|Seek|Width|Get|Put|Write)\b)
49+
match: (?i:\b(Open|Close|Line Input|Lock|Unlock|Print|Seek|Width|Get|Put|Write)\b)
50+
- name: keyword.io.vba
51+
match: "(?i:\\b(Input)(?= #))"
5052
- name: keyword.other.vba
5153
match: (?i:\b(Attribute|Call|End (Function|Property|Sub|Type|Enum)|(Const|Function|Property|Sub|Type|Enum)|Declare|PtrSafe|WithEvents|Event|RaiseEvent|Implements)\b)
5254
- name: keyword.other.option.vba

0 commit comments

Comments
 (0)