diff options
author | dos-reis <gdr@axiomatics.org> | 2011-10-01 14:02:30 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-10-01 14:02:30 +0000 |
commit | 73374b314b15f2a313718d0e347a1050d1d1a405 (patch) | |
tree | e893bb8f428e229c04445ffc11fdc0a2f3f6a1f5 /src/boot/translator.boot | |
parent | 4cb6f558586ccd4893c2acd088bba66654f6bf19 (diff) | |
download | open-axiom-73374b314b15f2a313718d0e347a1050d1d1a405.tar.gz |
* boot/utility.boot: Define BOOTTRAN namespace.
(setUnion): New.
(setDifference): New.
* boot/translator.boot (packageBody): New.
(translateToplevel): Use it. Translate namespace definition.
* boot/tokens.boot: Replace bitmask with bitref.
Do not translate setDifference and setUnion.
* boot/parser.boot (bpDef): Now include namespace definition.
(bpComma): Remove namespace rule as subsumed by Where rule.
* boot/Makefile.in: Remove dependencies on initial-env.lisp.
(AXIOM_LOCAL_LISP_sources): Remove as unused,
(boot_sources): Remove as redundant with boot_SOURCES.
* boot/initial-env.lisp: Remove.
Diffstat (limited to 'src/boot/translator.boot')
-rw-r--r-- | src/boot/translator.boot | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/boot/translator.boot b/src/boot/translator.boot index 35db495f..2ff8870c 100644 --- a/src/boot/translator.boot +++ b/src/boot/translator.boot @@ -419,6 +419,19 @@ exportNames ns == ns = nil => nil [inAllContexts ["EXPORT",quote ns]] +packageBody(x,p) == + x is ['%Import,['%Namespace,ns]] => + user := + p = nil => nil + [symbolName p] + ns is 'System => + ['COND, + [['%hasFeature,KEYWORD::COMMON_-LISP],['USE_-PACKAGE,'"COMMON-LISP",:user]], + ['T,['USE_-PACKAGE,'"LISP",:user]]] + ['USE_-PACKAGE,symbolName ns,:user] + x is ['PROGN,:.] => [x.op,:[packageBody(y,p) for y in x.args]] + x + translateToplevel(b,export?) == b isnt [.,:.] => [b] -- generally happens in interactive mode. b is ["TUPLE",:xs] => coreError '"invalid AST" @@ -433,8 +446,7 @@ translateToplevel(b,export?) == :[first translateToplevel(d,true) for d in ds]] %Import(m) => - m is ['%Namespace,n] => - [inAllContexts ["USE-PACKAGE",symbolName n]] + m is ['%Namespace,n] => [inAllContexts packageBody(m,nil)] if getOptionValue "import" ~= '"skip" then bootImport symbolName m [["IMPORT-MODULE", symbolName m]] @@ -445,6 +457,10 @@ translateToplevel(b,export?) == %TypeAlias(lhs, rhs) => [genTypeAlias(lhs,rhs)] %ConstantDefinition(lhs,rhs) => + lhs is ['%Namespace,ns] => + def := ['UNLESS,['FIND_-PACKAGE,symbolName ns], + ['MAKE_-PACKAGE,symbolName ns]] + [inAllContexts def,inAllContexts packageBody(rhs,ns)] sig := nil if lhs is ["%Signature",n,t] then sig := genDeclaration(n,t) |