aboutsummaryrefslogtreecommitdiff
path: root/guix/build/bournish.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/build/bournish.scm')
-rw-r--r--guix/build/bournish.scm17
1 files changed, 15 insertions, 2 deletions
diff --git a/guix/build/bournish.scm b/guix/build/bournish.scm
index 3bea1c80c2..1f17e0a22d 100644
--- a/guix/build/bournish.scm
+++ b/guix/build/bournish.scm
@@ -149,11 +149,24 @@ code as an sexp."
(define %bournish-language
(let ((scheme (lookup-language 'scheme)))
+ ;; XXX: The 'scheme' language lacks a "joiner", so we add one here. This
+ ;; allows us to have 'read-bournish' read one shell statement at a time
+ ;; instead of having to read until EOF.
+ (set! (language-joiner scheme)
+ (lambda (exps env)
+ (match exps
+ (() '(begin))
+ ((exp) exp)
+ (_ `(begin ,@exps)))))
+
(make-language #:name 'bournish
#:title "Bournish"
+
+ ;; The reader does all the heavy lifting.
#:reader read-bournish
- #:compilers (language-compilers scheme)
- #:decompilers (language-decompilers scheme)
+ #:compilers `((scheme . ,(lambda (exp env options)
+ (values exp env env))))
+ #:decompilers '()
#:evaluator (language-evaluator scheme)
#:printer (language-printer scheme)
#:make-default-environment