aboutsummaryrefslogtreecommitdiff
path: root/src/boot/strap
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/strap')
-rw-r--r--src/boot/strap/parser.clisp19
-rw-r--r--src/boot/strap/translator.clisp26
2 files changed, 30 insertions, 15 deletions
diff --git a/src/boot/strap/parser.clisp b/src/boot/strap/parser.clisp
index 7cf584dd..00b784f7 100644
--- a/src/boot/strap/parser.clisp
+++ b/src/boot/strap/parser.clisp
@@ -484,15 +484,18 @@
(PROG (|a|)
(RETURN
(COND
- ((|bpEqKey| 'IMPORT) (SETQ |a| (|bpState|))
- (OR (|bpName|) (|bpTrap|))
+ ((|bpEqKey| 'IMPORT)
(COND
- ((|bpEqPeek| 'COLON) (|bpRestore| |a|)
- (AND (OR (|bpSignature|) (|bpTrap|))
- (OR (|bpEqKey| 'FOR) (|bpTrap|))
- (OR (|bpName|) (|bpTrap|))
- (|bpPush| (|%ImportSignature| (|bpPop1|) (|bpPop1|)))))
- (T (|bpPush| (|%Import| (|bpPop1|))))))
+ ((|bpNamespace|) (|bpPush| (|%Import| (|bpPop1|))))
+ (T (SETQ |a| (|bpState|)) (OR (|bpName|) (|bpTrap|))
+ (COND
+ ((|bpEqPeek| 'COLON) (|bpRestore| |a|)
+ (AND (OR (|bpSignature|) (|bpTrap|))
+ (OR (|bpEqKey| 'FOR) (|bpTrap|))
+ (OR (|bpName|) (|bpTrap|))
+ (|bpPush|
+ (|%ImportSignature| (|bpPop1|) (|bpPop1|)))))
+ (T (|bpPush| (|%Import| (|bpPop1|))))))))
(T NIL)))))
(DEFUN |bpNamespace| ()
diff --git a/src/boot/strap/translator.clisp b/src/boot/strap/translator.clisp
index 6e73c749..3992e54d 100644
--- a/src/boot/strap/translator.clisp
+++ b/src/boot/strap/translator.clisp
@@ -593,8 +593,12 @@
((NULL |ns|) NIL)
(T (LIST (LIST 'EXPORT (LIST 'QUOTE |ns|))))))
+(DEFUN |inAllContexts| (|x|)
+ (LIST 'EVAL-WHEN (LIST :COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
+ |x|))
+
(DEFUN |translateToplevel| (|b| |export?|)
- (PROG (|lhs| |t| |ISTMP#2| |n| |ISTMP#1| |sig| |xs|)
+ (PROG (|lhs| |t| |ISTMP#2| |sig| |n| |ISTMP#1| |xs|)
(DECLARE (SPECIAL |$activeNamespace| |$InteractiveMode|
|$constantIdentifiers| |$foreignsDefsForCLisp|
|$currentModuleName|))
@@ -645,12 +649,20 @@
(CDR |bfVar#12|)))))))))
(|%Import|
(LET ((|m| (CADR |b|)))
- (PROGN
- (COND
- ((NOT (STRING= (|getOptionValue| '|import|)
- "skip"))
- (|bootImport| (SYMBOL-NAME |m|))))
- (LIST (LIST 'IMPORT-MODULE (SYMBOL-NAME |m|))))))
+ (COND
+ ((AND (CONSP |m|) (EQ (CAR |m|) '|%Namespace|)
+ (PROGN
+ (SETQ |ISTMP#1| (CDR |m|))
+ (AND (CONSP |ISTMP#1|)
+ (NULL (CDR |ISTMP#1|))
+ (PROGN (SETQ |n| (CAR |ISTMP#1|)) T))))
+ (LIST (|inAllContexts|
+ (LIST 'USE-PACKAGE (SYMBOL-NAME |n|)))))
+ (T (COND
+ ((NOT (STRING= (|getOptionValue| '|import|)
+ "skip"))
+ (|bootImport| (SYMBOL-NAME |m|))))
+ (LIST (LIST 'IMPORT-MODULE (SYMBOL-NAME |m|)))))))
(|%ImportSignature|
(LET ((|x| (CADR |b|)) (|sig| (CADDR |b|)))
(|genImportDeclaration| |x| |sig|)))