1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 13:00:26 +02:00

Create stub module forms for dependecies

* module/scripts/jslink.scm: Module files need a module form, or
  functions like resolve-module won't work correctly.
This commit is contained in:
Ian Price 2017-08-28 13:43:01 +01:00
parent 062e413cda
commit 11378b73df

View file

@ -1,6 +1,7 @@
(define-module (scripts jslink) (define-module (scripts jslink)
#:use-module (system base compile) #:use-module (system base compile)
#:use-module (system base language) #:use-module (system base language)
#:use-module (language javascript)
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
#:use-module (srfi srfi-37) #:use-module (srfi srfi-37)
#:use-module (ice-9 format) #:use-module (ice-9 format)
@ -20,9 +21,9 @@
(define boot-dependencies (define boot-dependencies
'(("ice-9/posix" . #f) '(("ice-9/posix" . #f)
("ice-9/ports" . #f) ("ice-9/ports" . (ice-9 ports))
("ice-9/threads" . #f) ("ice-9/threads" . (ice-9 threads))
("srfi/srfi-4" . #f) ("srfi/srfi-4" . (srfi srfi-4))
("ice-9/deprecated" . #t) ("ice-9/deprecated" . #t)
("ice-9/boot-9" . #t) ("ice-9/boot-9" . #t)
@ -137,6 +138,11 @@ Report bugs to <~A>.~%"
(format #t "boot_modules[~s] =\n" path) (format #t "boot_modules[~s] =\n" path)
(cond ((string? file) (cond ((string? file)
(compile-dependency file)) (compile-dependency file))
((list? file)
(print-statement (compile `(define-module ,file)
#:from 'scheme #:to 'javascript)
(current-output-port))
(newline))
(file (compile-dependency (%search-load-path path))) (file (compile-dependency (%search-load-path path)))
(else (else
(format #t "function (cont) { return cont(scheme.UNDEFINED); };"))) (format #t "function (cont) { return cont(scheme.UNDEFINED); };")))