Add while and until loop support

* geesh/eval.scm (eval-sh): Handle '<sh-while>' and '<sh-until>'
cases.
This commit is contained in:
Timothy Sample 2018-11-21 11:35:13 -05:00
parent 2335298226
commit 4d6e91565e
1 changed files with 5 additions and 1 deletions

View File

@ -103,6 +103,8 @@ environment @var{env}."
names words))
(('<sh-subshell> . sub-exps)
(sh:subshell env (exps->thunk env sub-exps)))
(('<sh-while> test-exp sub-exps ..1)
(sh:while env (exp->thunk env test-exp) (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
@ -152,4 +154,6 @@ environment @var{env}."
(#f (set-environment-status! env 1))
(redirs
(sh:with-redirects env redirs
(exp->thunk env sub-exp)))))))))
(exp->thunk env sub-exp)))))))
(('<sh-until> test-exp sub-exps ..1)
(sh:until env (exp->thunk env test-exp) (exps->thunk env sub-exps)))))