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

Loading…
Cancel
Save