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(
|
||||||
|
|
|
@ -329,6 +329,12 @@
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "word"
|
"name": "word"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "CHOICE",
|
||||||
|
"members": [
|
||||||
|
{
|
||||||
|
"type": "SEQ",
|
||||||
|
"members": [
|
||||||
{
|
{
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": "("
|
"value": "("
|
||||||
|
@ -336,10 +342,29 @@
|
||||||
{
|
{
|
||||||
"type": "STRING",
|
"type": "STRING",
|
||||||
"value": ")"
|
"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