fix 60-function.sh.
This commit is contained in:
parent
2df901d337
commit
58d1627b08
|
@ -64,7 +64,7 @@
|
|||
exclamation <- '!'
|
||||
pipe < sp* '|' !'|' ws*
|
||||
|
||||
command <-- function-def / compound-command / simple-command
|
||||
command <-- function / compound-command / simple-command
|
||||
|
||||
compound-command <- (subshell / brace-group / for-clause / case-clause /
|
||||
if-clause / while-clause / until-clause) (sp* io-redirect)*
|
||||
|
@ -90,9 +90,9 @@
|
|||
word <-- test / substitution /
|
||||
(number / variable-subst / variable / delim / literal)+
|
||||
|
||||
function-def <-- name sp* lpar rpar# ws* function-body
|
||||
function <-- name sp* lpar rpar# ws* function-body
|
||||
name <-- !reserved identifier
|
||||
function-body <-- brace-group (sp* io-redirect)*
|
||||
function-body <- brace-group (sp* io-redirect)*
|
||||
|
||||
subshell <-- lpar compound rpar#
|
||||
brace-group <-- lbrace ws* compound rbrace#
|
||||
|
@ -278,5 +278,8 @@
|
|||
|
||||
(('elif elif ...) (transform `(if-clause ,@elif)))
|
||||
|
||||
(('function name body)
|
||||
`(function ,name (lambda ( . args) ,(transform body))))
|
||||
|
||||
((h t ...) (map transform o))
|
||||
(_ o)))
|
||||
|
|
Loading…
Reference in New Issue