Mix functions and commands

main
Clément FRÉVILLE 2 years ago
parent 62ab651250
commit 48039d979e
Signed by: clement.freville2
GPG Key ID: 732E73BB80FA6076

@ -110,3 +110,24 @@ Negated command
(command_name
(identifier))
(word)))
===============================
Mix functions and commands
===============================
generate() | cut -d ' ' -f 1
---
(source_file
(pipeline
(call_expression
(identifier)
(argument_list))
(command
(command_name
(identifier))
(word)
(raw_string)
(word)
(word))))

@ -25,7 +25,6 @@ module.exports = grammar({
$.variable_declaration,
$._statement,
$.return,
$.while,
'break',
'continue',
),
@ -74,6 +73,7 @@ module.exports = grammar({
_statement: $ => choice(
$.command,
$.pipeline,
$.while,
seq('!', $.command),
$._expression,
),
@ -174,7 +174,7 @@ module.exports = grammar({
line_comment: $ => token(seq('//', /.*/)),
block_comment: $ => token(seq('/*', /[^*]*\*+([^/*][^*]*\*+)*/, '/')),
identifier: $ => /[a-zA-Z_][a-zA-Z0-9_]*/,
word: $ => /[^#'"\\\s$<>{}&;]+/,
word: $ => /[^#'"\\\s$<>{}&;()]+/,
number: $ => /\d+/,
boolean: $ => choice('true', 'false'),
template_string: $ => seq(

Loading…
Cancel
Save