mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
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
This commit is contained in:
parent
c2589b5c48
commit
536d94feb3
2 changed files with 16 additions and 0 deletions
|
@ -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))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue