transform: translate script to begin or command.
This commit is contained in:
parent
b89ca17134
commit
df73d5421f
|
@ -228,6 +228,10 @@
|
|||
|
||||
(define (transform o)
|
||||
(match o
|
||||
|
||||
(('script command) (transform command))
|
||||
(('script command ...) `(begin ,@(map transform command)))
|
||||
|
||||
(('command word ... ('io-redirect ('io-here "<<" ('io-here-document string))))
|
||||
`(pipeline (cut display ,string) (command ,@word)))
|
||||
(('command word ... ('io-redirect filedes ... ('io-file ">" file-name)))
|
||||
|
@ -238,5 +242,6 @@
|
|||
(else (error (format #f "TODO: output to filedes=~a\n" filedes)))))
|
||||
(('command word ... ('io-redirect ('io-file "<" file-name)))
|
||||
`(with-input-from-file ,file-name (command ,@word)))
|
||||
|
||||
((h t ...) (map transform o))
|
||||
(_ o)))
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
or-terms
|
||||
pipeline
|
||||
run
|
||||
script
|
||||
script-status
|
||||
sequence
|
||||
singlequotes
|
||||
|
@ -147,9 +146,6 @@
|
|||
(define (script-status)
|
||||
((compose string->number variable) "?"))
|
||||
|
||||
(define (script . o)
|
||||
o)
|
||||
|
||||
(define (for-clause name sequence body)
|
||||
(for-each (lambda (value)
|
||||
(assignment name value)
|
||||
|
|
Loading…
Reference in New Issue