aboutsummaryrefslogtreecommitdiff
path: root/src/boot/strap
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-10-01 22:21:23 +0000
committerdos-reis <gdr@axiomatics.org>2011-10-01 22:21:23 +0000
commit496ca25659180bb29cc5fea2f3c0337695d742d3 (patch)
treefe020f749b8247903bc66b576c273b61c5aa46ae /src/boot/strap
parent73374b314b15f2a313718d0e347a1050d1d1a405 (diff)
downloadopen-axiom-496ca25659180bb29cc5fea2f3c0337695d742d3.tar.gz
* boot/parser.boot (bpImport): Accept long names for used namespaces.
* boot/translator.boot (packageBody): Tidy. (translateToplevel): Likewise. (getIntermediateLispFile): Likewise. * interp/sys-os.boot: Import System.Foreign.
Diffstat (limited to 'src/boot/strap')
-rw-r--r--src/boot/strap/parser.clisp22
-rw-r--r--src/boot/strap/translator.clisp37
-rw-r--r--src/boot/strap/utility.clisp3
3 files changed, 39 insertions, 23 deletions
diff --git a/src/boot/strap/parser.clisp b/src/boot/strap/parser.clisp
index 7b470d05..3d8d15f8 100644
--- a/src/boot/strap/parser.clisp
+++ b/src/boot/strap/parser.clisp
@@ -440,15 +440,19 @@
(RETURN
(COND
((|bpEqKey| 'IMPORT)
- (COND ((|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|))))))))
+ (COND
+ ((|bpEqKey| 'NAMESPACE)
+ (OR
+ (AND (|bpLeftAssoc| '(DOT) #'|bpName|)
+ (|bpPush| (|%Import| (|bfNamespace| (|bpPop1|)))))
+ (|bpTrap|)))
+ (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 95ad05d9..7ce79ebe 100644
--- a/src/boot/strap/translator.clisp
+++ b/src/boot/strap/translator.clisp
@@ -566,7 +566,7 @@
(T (LIST (|inAllContexts| (LIST 'EXPORT (|quote| |ns|)))))))
(DEFUN |packageBody| (|x| |p|)
- (PROG (|user| |ns| |ISTMP#3| |ISTMP#2| |ISTMP#1|)
+ (PROG (|z| |user| |ns| |ISTMP#3| |ISTMP#2| |ISTMP#1|)
(RETURN
(COND
((AND (CONSP |x|) (EQ (CAR |x|) '|%Import|)
@@ -587,7 +587,25 @@
(LIST (LIST '|%hasFeature| :COMMON-LISP)
(CONS 'USE-PACKAGE (CONS "COMMON-LISP" |user|)))
(LIST 'T (CONS 'USE-PACKAGE (CONS "LISP" |user|)))))
- (T (CONS 'USE-PACKAGE (CONS (SYMBOL-NAME |ns|) |user|)))))
+ (T
+ (SETQ |z|
+ (COND
+ ((AND (CONSP |ns|) (EQ (CAR |ns|) 'DOT)
+ (PROGN
+ (SETQ |ISTMP#1| (CDR |ns|))
+ (AND (CONSP |ISTMP#1|) (EQ (CAR |ISTMP#1|) '|System|)
+ (PROGN
+ (SETQ |ISTMP#2| (CDR |ISTMP#1|))
+ (AND (CONSP |ISTMP#2|) (NULL (CDR |ISTMP#2|))
+ (EQ (CAR |ISTMP#2|) '|Foreign|))))))
+ (COND ((|%hasFeature| :SBCL) 'SB-ALIEN)
+ ((|%hasFeature| :CLISP) 'FFI)
+ ((|%hasFeature| :CLOZURE) 'CCL)
+ ((|%hasFeature| :ECL) 'EXT) ((|%hasFeature| :GCL) 'SI)
+ (T NIL)))
+ ((|ident?| |ns|) |ns|) (T NIL)))
+ (COND ((NULL |z|) (|bpTrap|))
+ (T (CONS 'USE-PACKAGE (CONS (SYMBOL-NAME |z|) |user|)))))))
((AND (CONSP |x|) (EQ (CAR |x|) 'PROGN))
(CONS (CAR |x|)
(LET ((|bfVar#2| NIL)
@@ -607,7 +625,7 @@
(T |x|)))))
(DEFUN |translateToplevel| (|b| |export?|)
- (PROG (|lhs| |t| |ISTMP#2| |sig| |def| |ns| |n| |ISTMP#1| |xs|)
+ (PROG (|lhs| |t| |ISTMP#2| |sig| |ns| |n| |ISTMP#1| |xs|)
(DECLARE
(SPECIAL |$currentModuleName| |$foreignsDefsForCLisp|
|$constantIdentifiers| |$InteractiveMode| |$activeNamespace|))
@@ -662,7 +680,7 @@
(SETQ |ISTMP#1| (CDR |m|))
(AND (CONSP |ISTMP#1|) (NULL (CDR |ISTMP#1|))
(PROGN (SETQ |n| (CAR |ISTMP#1|)) T))))
- (LIST (|inAllContexts| (|packageBody| |m| NIL))))
+ (LIST (|inAllContexts| (|packageBody| |b| NIL))))
(T
(COND
((NOT (STRING= (|getOptionValue| '|import|) "skip"))
@@ -682,11 +700,7 @@
(SETQ |ISTMP#1| (CDR |lhs|))
(AND (CONSP |ISTMP#1|) (NULL (CDR |ISTMP#1|))
(PROGN (SETQ |ns| (CAR |ISTMP#1|)) T))))
- (SETQ |def|
- (LIST 'UNLESS
- (LIST 'FIND-PACKAGE (SYMBOL-NAME |ns|))
- (LIST 'MAKE-PACKAGE (SYMBOL-NAME |ns|))))
- (LIST (|inAllContexts| |def|)
+ (LIST (LIST 'DEFPACKAGE (SYMBOL-NAME |ns|))
(|inAllContexts| (|packageBody| |rhs| |ns|))))
(T (SETQ |sig| NIL)
(COND
@@ -1234,9 +1248,8 @@
(SETQ |out| (NAMESTRING (|getOutputPathname| |options|)))
(COND
(|out|
- (CONCAT
- (|shoeRemoveStringIfNec| (CONCAT "." |$effectiveFaslType|) |out|)
- ".clisp"))
+ (CONCAT (|shoeRemoveStringIfNec| (CONCAT "." |$faslType|) |out|)
+ ".clisp"))
(T (|defaultBootToLispFile| |file|)))))))
(DEFUN |translateBootFile| (|progname| |options| |file|)
diff --git a/src/boot/strap/utility.clisp b/src/boot/strap/utility.clisp
index 7137a1c6..8a06ff0c 100644
--- a/src/boot/strap/utility.clisp
+++ b/src/boot/strap/utility.clisp
@@ -1,6 +1,5 @@
(PROCLAIM '(OPTIMIZE SPEED))
-(EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
- (UNLESS (FIND-PACKAGE #1="BOOTTRAN") (MAKE-PACKAGE #1#)))
+(DEFPACKAGE "BOOTTRAN")
(EVAL-WHEN (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
(PROGN