Add missing function definition forms
This commit is contained in:
parent
75833b90ea
commit
52d54bb173
|
@ -129,8 +129,20 @@ function do_something_else() {
|
|||
echo ok
|
||||
}
|
||||
|
||||
function do_yet_another_thing {
|
||||
echo ok
|
||||
} 2>&1
|
||||
|
||||
---
|
||||
|
||||
(program
|
||||
(function_definition (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))))
|
||||
(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(
|
||||
optional('function'),
|
||||
$.word,
|
||||
'(',
|
||||
')',
|
||||
$.compound_statement
|
||||
optional(seq('(', ')')),
|
||||
$.compound_statement,
|
||||
optional($.file_redirect)
|
||||
),
|
||||
|
||||
compound_statement: $ => seq(
|
||||
|
|
|
@ -329,6 +329,12 @@
|
|||
"type": "SYMBOL",
|
||||
"name": "word"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "("
|
||||
|
@ -336,10 +342,29 @@
|
|||
{
|
||||
"type": "STRING",
|
||||
"value": ")"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"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