Add subshell support

* geesh/eval.scm (exps->thunk): New function.
(eval-sh): Handle '<sh-subshell>'.
This commit is contained in:
Timothy Sample 2018-07-18 15:09:11 -04:00
parent 8739cafad9
commit 3148f66a21
1 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,9 @@
(define (exp->thunk env exp)
(lambda () (eval-sh env exp)))
(define (exps->thunk env exps)
(lambda () (eval-sh env `(<sh-begin> ,@exps))))
(define (eval-sh env exp)
"Evaluate the Shell expression @var{exp} in the context of the Shell
environment @var{env}."
@ -68,6 +71,8 @@ environment @var{env}."
#:split? #f
#:rhs-tildes? #t)))
names words))
(('<sh-subshell> . sub-exps)
(sh:subshell env (exps->thunk env sub-exps)))
(('<sh-with-redirects> (redirs ..1) sub-exp)
(match sub-exp
;; For "simple commands" we have to observe a special order of