standalone export form now handles (import import-spec ...)

original commit: 09b6745679892fe2fac761d5849fe78b87d57dcf
This commit is contained in:
Oscar Waddell 2018-03-28 15:11:10 -04:00 committed by Bob Burger
parent b3cf76c3e8
commit 9d1b935705
4 changed files with 32 additions and 7 deletions

2
LOG
View File

@ -897,3 +897,5 @@
schlib.c
- install equates.h, kernel.o, and main.o on unix-like systems
Mf-install.in
- standalone export form now handles (import import-spec ...)
8.ms, syntax.ss, release_notes.stex

View File

@ -7976,6 +7976,19 @@
(equal?
(let () (import ($l3)) (f (f 3)))
3)
(begin
;; (export import-spec ...) empty case
(library ($empty) (export) (import (chezscheme)) (export (import)))
#t)
(begin
(library ($l4-A) (export a) (import (chezscheme)) (define a 1))
(library ($l4-B) (export b) (import (chezscheme)) (define b 2))
#t)
(equal? '(1 2) (let () (import ($l4-A) ($l4-B)) (list a b)))
(begin
;; (export import-spec ...) multiple imports case
(library ($l4-C) (export) (import (chezscheme)) (export (import ($l4-A) ($l4-B))))
(equal? '(1 2) (let () (import ($l4-C)) (list a b))))
)
(mat library2

View File

@ -1554,6 +1554,12 @@ in fasl files does not generally make sense.
%-----------------------------------------------------------------------------
\section{Bug Fixes}\label{section:bugfixes}
\subsection{Incomplete handling of import specs within standalone export forms}
A bug that limited the \scheme{(import \var{import-spec} \dots)} form within a
standalone \scheme{export} form to \scheme{(import \var{import-spec})} has been
fixed.
\subsection{Permission denied after deleting files or directories in Windows}
In Windows, deleting a file or directory briefly leaves the file or

View File

@ -4280,14 +4280,18 @@
(append #'(old-id ...) exports)
(append #'(old-id ...) exports-to-check)
(fold-right resolve&add-id new-exports #'(old-id ...) #'(new-id ...)))]
[(?import impspec)
[(?import impspec ...)
(sym-kwd? ?import import)
(let-values ([(mid tid imps) (help-determine-imports #'impspec r #f)])
(let ([imps (if (import-interface? imps) (module-exports imps) imps)])
(values
(append (map car imps) exports)
exports-to-check
(fold-right add-id new-exports (map cdr imps)))))]
(let process-impspecs ([impspec* #'(impspec ...)])
(if (null? impspec*)
(values exports exports-to-check new-exports)
(let-values ([(_mid _tid imps) (help-determine-imports (car impspec*) r #f)]
[(exports exports-to-check new-exports) (process-impspecs (cdr impspec*))])
(let ([imps (if (import-interface? imps) (module-exports imps) imps)])
(values
(append (map car imps) exports)
exports-to-check
(fold-right add-id new-exports (map cdr imps)))))))]
[_ (syntax-error x "invalid export spec")])))))])
(g (cdr expspec**) exports exports-to-check new-exports))))))
)