@@ -28,6 +28,7 @@ module.exports = grammar({
28
28
_atom : ( $ ) => choice (
29
29
$ . word ,
30
30
$ . _atom_common ,
31
+ $ . _args ,
31
32
) ,
32
33
word : ( $ ) => choice (
33
34
token ( prec ( - 1 , / [ ^ , ( \[ \n \t ] + / ) ) ,
@@ -37,6 +38,7 @@ module.exports = grammar({
37
38
_atom_noli : ( $ ) => choice (
38
39
alias ( $ . word_noli , $ . word ) ,
39
40
$ . _atom_common ,
41
+ // $._args,
40
42
) ,
41
43
word_noli : ( $ ) => choice (
42
44
// Lines contained by line_li must not start with a listitem symbol.
@@ -58,7 +60,7 @@ module.exports = grammar({
58
60
) ,
59
61
60
62
// Explicit special cases: these are plaintext, not errors.
61
- _word_common : ( ) => choice (
63
+ _word_common : ( ) => prec . left ( choice (
62
64
// NOT tag: isolated "*".
63
65
'*' ,
64
66
// NOT optionlink: '
@@ -83,7 +85,7 @@ module.exports = grammar({
83
85
// NOT codeblock: random ">" in middle of the motherflippin text.
84
86
'>' ,
85
87
',' ,
86
- ) ,
88
+ ) ) ,
87
89
88
90
keycode : ( ) => choice (
89
91
/ < [ - a - z A - Z 0 - 9 _ ] + > / ,
@@ -210,6 +212,7 @@ module.exports = grammar({
210
212
// Inline code (may contain whitespace!): `foo bar`
211
213
codespan : ( $ ) => _word ( $ , / [ ^ ` ` \n ] + / , '`' , '`' ) ,
212
214
// Argument: {arg} (no whitespace allowed)
215
+ _args : ( $ ) => seq ( '[' , $ . argument , repeat1 ( seq ( optional ( ',' ) , $ . argument ) ) , ']' ) ,
213
216
argument : ( $ ) => _word ( $ , / [ ^ } \n \t ] + / , '{' , '}' ) ,
214
217
// Optional argument: [arg] (no whitespace allowed)
215
218
optional_arg : ( $ ) => _word ( $ , / [ ^ \] \n \t ] + / , '[' , ']' ) ,
0 commit comments