Add missing function definition forms
This commit is contained in:
parent
75833b90ea
commit
52d54bb173
|
@ -129,8 +129,20 @@ function do_something_else() {
|
||||||
echo ok
|
echo ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function do_yet_another_thing {
|
||||||
|
echo ok
|
||||||
|
} 2>&1
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
(program
|
(program
|
||||||
(function_definition (word) (compound_statement (command (command_name (word)) (word))))
|
(function_definition
|
||||||
(function_definition (word) (compound_statement (command (command_name (word)) (word)))))
|
(word)
|
||||||
|
(compound_statement (command (command_name (word)) (word))))
|
||||||
|
(function_definition
|
||||||
|
(word)
|
||||||
|
(compound_statement (command (command_name (word)) (word))))
|
||||||
|
(function_definition
|
||||||
|
(word)
|
||||||
|
(compound_statement (command (command_name (word)) (word)))
|
||||||
|
(file_redirect (file_descriptor) (word))))
|
||||||
|
|
|
@ -124,9 +124,9 @@ module.exports = grammar({
|
||||||
function_definition: $ => seq(
|
function_definition: $ => seq(
|
||||||
optional('function'),
|
optional('function'),
|
||||||
$.word,
|
$.word,
|
||||||
'(',
|
optional(seq('(', ')')),
|
||||||
')',
|
$.compound_statement,
|
||||||
$.compound_statement
|
optional($.file_redirect)
|
||||||
),
|
),
|
||||||
|
|
||||||
compound_statement: $ => seq(
|
compound_statement: $ => seq(
|
||||||
|
|
|
@ -330,16 +330,41 @@
|
||||||
"name": "word"
|
"name": "word"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "STRING",
|
"type": "CHOICE",
|
||||||
"value": "("
|
"members": [
|
||||||
},
|
{
|
||||||
{
|
"type": "SEQ",
|
||||||
"type": "STRING",
|
"members": [
|
||||||
"value": ")"
|
{
|
||||||
|
"type": "STRING",
|
||||||
|
"value": "("
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "STRING",
|
||||||
|
"value": ")"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "BLANK"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "compound_statement"
|
"name": "compound_statement"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "CHOICE",
|
||||||
|
"members": [
|
||||||
|
{
|
||||||
|
"type": "SYMBOL",
|
||||||
|
"name": "file_redirect"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "BLANK"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue