Fix AST for redirects and assignments
This should have been in 2b05199562
, but
it was overlooked.
* geesh/parser.scm (make-parser): Splice in arguments in the redirect
case (to be consistent with the non-redirect case).
* tests/parser.scm: Add a test for this.
This commit is contained in:
parent
870c10b37a
commit
48e122c42f
|
@ -490,7 +490,7 @@ the same number of times.)"
|
|||
(_ `(<sh-with-redirects> ,redirects
|
||||
,(if (null? assignments)
|
||||
#f
|
||||
`(<sh-set!> ,assignments))))))
|
||||
`(<sh-set!> ,@assignments))))))
|
||||
(cmd-name cmd-suffix)
|
||||
: (let-values (((redirects args) (partition io-redirect? $2)))
|
||||
(match redirects
|
||||
|
|
|
@ -99,6 +99,11 @@
|
|||
'(<sh-set!> ("FOO" "bar") ("BAZ" "quux"))
|
||||
(parse "FOO=bar BAZ=quux"))
|
||||
|
||||
(test-equal "Parses redirects with assignments but no command"
|
||||
'(<sh-with-redirects> ((> 2 "bar"))
|
||||
(<sh-set!> ("FOO" "bar")))
|
||||
(parse "FOO=bar 2>bar"))
|
||||
|
||||
;; Boolean expressions
|
||||
|
||||
(test-equal "Parses disjunctions"
|
||||
|
|
Loading…
Reference in New Issue