1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

Add `guild jslink' to bundle JS programs

* module/Makefile.am (SOURCES): Install runtime.js and jslink.scm
* module/language/js-il/compile-javascript.scm (compile-exp):
  Compilation units take a continuation to facilitate linking.
* module/scripts/jslink.scm: New script.
This commit is contained in:
Ian Price 2017-08-09 16:06:50 +01:00
parent 7438a192f8
commit 56439a88ae
3 changed files with 187 additions and 11 deletions

View file

@ -141,18 +141,17 @@
(make-call (compile-id name)
(list
(make-id "undefined")
(make-refine *scheme* (make-const "initial_cont")))))))
(make-call (make-function
'()
(append
(map (lambda (id f)
(make-var (rename-id id)
(compile-exp f)))
(cons name names)
(cons fun funs))
(make-id "unit_cont"))))))
(make-function
(list "unit_cont")
(append
(map (lambda (id f)
(make-var (rename-id id)
(compile-exp f)))
(cons name names)
(cons fun funs))
(list entry-call)))
'())))
(list entry-call)))))
(($ il:continuation params body)
(make-function (map rename-id params) (list (compile-exp body))))