Skip to content

Commit 2ec8b4e

Browse files
committed
fix: NOT optionlink: 'x
1 parent c8aeb94 commit 2ec8b4e

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

corpus/optionlink.txt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ world 'hello' world
2929
(word))))
3030

3131
================================================================================
32-
NOT optionlink: ' followed by whitespace
32+
NOT optionlink: ' or 'x
3333
================================================================================
3434
'fillchars'
35-
stl ' ' or '^' statusline
36-
wbr ' ' windowbar
37-
tricky: ' 'yes'
35+
stl ' ' or '^' statusline
36+
wbr ' ' windowbar
37+
tricky: ' 'yes' 's foo
3838

3939

4040
--------------------------------------------------------------------------------
@@ -60,12 +60,14 @@ NOT optionlink: ' followed by whitespace
6060
(word)
6161
(word)
6262
(optionlink
63-
(word)))))
63+
(word))
64+
(word)
65+
(word))))
6466

6567
================================================================================
6668
NOT optionlink #7 #14
6769
================================================================================
68-
Let's see if that works.
70+
Let's see.
6971
no! ','sqlKeyword'
7072
single-char '-' 'g' '보'
7173
non-ascii: '\"' '%)' '-bang' '.*\\.log' '.gitignore' '@{${\"foo\"}}'
@@ -80,9 +82,6 @@ number: '04' 'ISO-10646-1' 'python3'
8082
(help_file
8183
(block
8284
(line
83-
(word)
84-
(word)
85-
(word)
8685
(word)
8786
(word))
8887
(line
@@ -155,8 +154,7 @@ x `after_codespan`'s
155154
(word)
156155
(codespan
157156
(word))
158-
(word)
159-
(ERROR))))
157+
(word))))
160158

161159
================================================================================
162160
NOT optionlink 3

grammar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ module.exports = grammar({
6161

6262
// Explicit special cases: these are plaintext, not errors.
6363
_word_common: () => choice(
64-
// NOT optionlink: single "'".
64+
// NOT optionlink: '
6565
"'",
66+
// NOT optionlink: 'x
67+
seq("'", token.immediate(/[^'\n\t ]/)),
6668
// NOT optionlink: followed by non-lowercase char.
6769
seq("'", token.immediate(/[a-z]*[^'a-z\n\t ][a-z]*/), optional(token.immediate("'"))),
6870
// NOT optionlink: single char surrounded by "'".

0 commit comments

Comments
 (0)