diff --git a/gash/grammar.scm b/gash/grammar.scm index 757b608..941d940 100644 --- a/gash/grammar.scm +++ b/gash/grammar.scm @@ -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))) diff --git a/gash/script.scm b/gash/script.scm index 01de558..bcdcc9a 100644 --- a/gash/script.scm +++ b/gash/script.scm @@ -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)