8
8
// - Rules starting with underscore are hidden in the syntax tree.
9
9
10
10
const _uppercase_word = / [ A - Z 0 - 9 . ( ) ] [ - A - Z 0 - 9 . ( ) _ ] + / ;
11
- const _li_token = / [ - * + • ] [ ] + / ;
11
+ const _li_token = / [ - • ] [ ] + / ;
12
12
13
13
module . exports = grammar ( {
14
14
name : 'vimdoc' ,
@@ -27,7 +27,7 @@ module.exports = grammar({
27
27
28
28
_atom : ( $ ) => choice (
29
29
$ . word ,
30
- $ . _atom_common
30
+ $ . _atom_common ,
31
31
) ,
32
32
word : ( $ ) => choice (
33
33
// Try the more-restrictive pattern at higher relative precedence, so that things like
@@ -39,12 +39,12 @@ module.exports = grammar({
39
39
40
40
_atom_noli : ( $ ) => prec ( 1 , choice (
41
41
alias ( $ . word_noli , $ . word ) ,
42
- $ . _atom_common
42
+ $ . _atom_common ,
43
43
) ) ,
44
44
word_noli : ( $ ) => prec ( 1 , choice (
45
45
// Lines contained by line_li must not start with a listitem symbol.
46
- token ( prec ( - 1 , / [ ^ - * + • \n \t ] [ ^ \n \t ] * / ) ) ,
47
- token ( prec ( - 1 , / [ - * + • ] [ ^ \n \t ] + / ) ) ,
46
+ token ( prec ( - 1 , / [ ^ - • \n \t ] [ ^ \n \t ] * / ) ) ,
47
+ token ( prec ( - 1 , / [ - • ] [ ^ \n \t ] + / ) ) ,
48
48
$ . _word_common ,
49
49
) ) ,
50
50
@@ -61,13 +61,15 @@ module.exports = grammar({
61
61
62
62
// Explicit special cases: these are plaintext, not errors.
63
63
_word_common : ( ) => choice (
64
+ // NOT tag: isolated "*".
65
+ / \* [ \n \t ] / ,
64
66
// NOT optionlink: '
65
67
"'" ,
66
68
// NOT optionlink: 'x
67
69
seq ( "'" , token . immediate ( / [ ^ ' \n \t ] / ) ) ,
68
- // NOT optionlink: followed by non-lowercase char.
70
+ // NOT optionlink: 'X ( non-lowercase char) .
69
71
seq ( "'" , token . immediate ( / [ a - z ] * [ ^ ' a - z \n \t ] [ a - z ] * / ) , optional ( token . immediate ( "'" ) ) ) ,
70
- // NOT optionlink: single char surrounded by "'" .
72
+ // NOT optionlink: 'x' ( single char) .
71
73
seq ( "'" , token . immediate ( / [ ^ ' \n \t ] / ) , token . immediate ( "'" ) ) ,
72
74
// NOT taglink: "||", "|"
73
75
/ \| \| + / ,
0 commit comments