summaryrefslogtreecommitdiff
path: root/module/language/js-il/compile-javascript.scm
diff options
context:
space:
mode:
authorIan Price <ianprice90@googlemail.com>2017-06-20 22:50:06 +0100
committerIan Price <ianprice90@googlemail.com>2017-06-20 22:50:06 +0100
commit536d94feb3288c22517e565f45059ec5ea824cc8 (patch)
tree8cef7042b20753cf3db8172445a03eba41e61924 /module/language/js-il/compile-javascript.scm
parentc2589b5c48da8bdcb4690fc5124e9bb6a54b0b22 (diff)
downloadguile-536d94feb3288c22517e565f45059ec5ea824cc8.tar.gz
Compile Syntax Objects to Javascript
* module/language/js-il/compile-javascript.scm (compile-const): Handle the new syntax object struct. * module/language/js-il/runtime.js(scheme.Syntax): Add Syntax Object type
Diffstat (limited to 'module/language/js-il/compile-javascript.scm')
-rw-r--r--module/language/js-il/compile-javascript.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/module/language/js-il/compile-javascript.scm b/module/language/js-il/compile-javascript.scm
index ed764410b..4ac782064 100644
--- a/module/language/js-il/compile-javascript.scm
+++ b/module/language/js-il/compile-javascript.scm
@@ -6,6 +6,7 @@
#:use-module (language javascript simplify)
#:use-module (language js-il inlining)
#:use-module (system foreign)
+ #:use-module (system syntax internal)
#:export (compile-javascript))
(define (undefined? obj)
@@ -355,5 +356,12 @@
(list (make-const (symbol->string (keyword->symbol c)))))))
((undefined? c)
(make-refine *scheme* (make-const "UNDEFINED")))
+ ((syntax? c)
+ (make-call
+ (make-refine *scheme* (make-const "Syntax"))
+ (map compile-const
+ (list (syntax-expression c)
+ (syntax-wrap c)
+ (syntax-module c)))))
(else
(throw 'uncompilable-const c))))