parent
53446e0e81
commit
e9748c132b
|
@ -322,7 +322,7 @@ do_something() {
|
|||
}
|
||||
|
||||
function do_something_else() {
|
||||
echo ok
|
||||
a | xargs -I{} find xml/{} -type f
|
||||
}
|
||||
|
||||
function do_yet_another_thing {
|
||||
|
@ -337,7 +337,16 @@ function do_yet_another_thing {
|
|||
(compound_statement (command (command_name (word)) (word))))
|
||||
(function_definition
|
||||
(word)
|
||||
(compound_statement (command (command_name (word)) (word))))
|
||||
(compound_statement
|
||||
(pipeline
|
||||
(command (command_name (word)))
|
||||
(command
|
||||
(command_name (word))
|
||||
(concatenation (word))
|
||||
(word)
|
||||
(concatenation (word))
|
||||
(word)
|
||||
(word)))))
|
||||
(redirected_statement (function_definition
|
||||
(word)
|
||||
(compound_statement (command (command_name (word)) (word))))
|
||||
|
|
21
grammar.js
21
grammar.js
|
@ -18,6 +18,7 @@ module.exports = grammar({
|
|||
$._statement,
|
||||
$._terminator,
|
||||
$._literal,
|
||||
$._statements2,
|
||||
$._primary_expression,
|
||||
$._simple_variable_name,
|
||||
$._special_variable_name,
|
||||
|
@ -62,6 +63,12 @@ module.exports = grammar({
|
|||
optional($._terminator)
|
||||
)),
|
||||
|
||||
_statements2: $ => repeat1(seq(
|
||||
$._statement,
|
||||
optional(seq('\n', $.heredoc_body)),
|
||||
$._terminator
|
||||
)),
|
||||
|
||||
_terminated_statement: $ => seq(
|
||||
$._statement,
|
||||
$._terminator
|
||||
|
@ -133,7 +140,7 @@ module.exports = grammar({
|
|||
|
||||
do_group: $ => seq(
|
||||
'do',
|
||||
optional($._statements),
|
||||
optional($._statements2),
|
||||
'done'
|
||||
),
|
||||
|
||||
|
@ -141,7 +148,7 @@ module.exports = grammar({
|
|||
'if',
|
||||
$._terminated_statement,
|
||||
'then',
|
||||
optional($._statements),
|
||||
optional($._statements2),
|
||||
repeat($.elif_clause),
|
||||
optional($.else_clause),
|
||||
'fi'
|
||||
|
@ -151,12 +158,12 @@ module.exports = grammar({
|
|||
'elif',
|
||||
$._terminated_statement,
|
||||
'then',
|
||||
optional($._statements)
|
||||
optional($._statements2)
|
||||
),
|
||||
|
||||
else_clause: $ => seq(
|
||||
'else',
|
||||
optional($._statements)
|
||||
optional($._statements2)
|
||||
),
|
||||
|
||||
case_statement: $ => seq(
|
||||
|
@ -198,7 +205,11 @@ module.exports = grammar({
|
|||
|
||||
compound_statement: $ => seq(
|
||||
'{',
|
||||
optional($._statements),
|
||||
repeat(seq(
|
||||
$._statement,
|
||||
optional(seq('\n', $.heredoc_body)),
|
||||
$._terminator
|
||||
)),
|
||||
'}'
|
||||
),
|
||||
|
||||
|
|
|
@ -97,6 +97,43 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"_statements2": {
|
||||
"type": "REPEAT1",
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_statement"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "\n"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "heredoc_body"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_terminator"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"_terminated_statement": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
|
@ -376,7 +413,7 @@
|
|||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_statements"
|
||||
"name": "_statements2"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
|
@ -409,7 +446,7 @@
|
|||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_statements"
|
||||
"name": "_statements2"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
|
@ -461,7 +498,7 @@
|
|||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_statements"
|
||||
"name": "_statements2"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
|
@ -482,7 +519,7 @@
|
|||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_statements"
|
||||
"name": "_statements2"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
|
@ -736,17 +773,42 @@
|
|||
"value": "{"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"type": "REPEAT",
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_statements"
|
||||
"name": "_statement"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "\n"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "heredoc_body"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_terminator"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "}"
|
||||
|
@ -2310,6 +2372,7 @@
|
|||
"_statement",
|
||||
"_terminator",
|
||||
"_literal",
|
||||
"_statements2",
|
||||
"_primary_expression",
|
||||
"_simple_variable_name",
|
||||
"_special_variable_name"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue