Complete grammar for unquoted arguments
This commit is contained in:
parent
98412845cd
commit
263fb2a5ff
15
grammar.js
15
grammar.js
|
@ -9,17 +9,22 @@ module.exports = grammar({
|
|||
newline: $ => /\n/,
|
||||
identifier: $ => /[A-Za-z_][A-Za-z0-9_]*/,
|
||||
argument: $ => /[^ ()#\"\\]+/,
|
||||
seperation: $ => choice($.space, $.line_ending),
|
||||
|
||||
arguments: $ => seq($.argument, repeat($._seperated_arguments)),
|
||||
_seperated_arguments: $ => prec.left(1, seq(
|
||||
repeat1($.seperation),
|
||||
optional($.argument)
|
||||
)),
|
||||
|
||||
command_invocation: $ => seq(
|
||||
repeat($.space),
|
||||
$.identifier,
|
||||
repeat($.space),
|
||||
$.parameter_list,
|
||||
),
|
||||
parameter_list: $ => seq(
|
||||
'(',
|
||||
repeat($.argument),
|
||||
optional($.arguments),
|
||||
')'
|
||||
)
|
||||
),
|
||||
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue