diff options
author | dos-reis <gdr@axiomatics.org> | 2009-08-29 13:07:26 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2009-08-29 13:07:26 +0000 |
commit | 620e2d0401eecb68292ec1ffc1b5d6b9e1cbb315 (patch) | |
tree | 696f6bf7ee680945f33affeac6d192d1e903dfff /src/boot/translator.boot | |
parent | cc585f67f7f20699c553aac715b1d5de9cbf8276 (diff) | |
download | open-axiom-620e2d0401eecb68292ec1ffc1b5d6b9e1cbb315.tar.gz |
* boot/ast.boot: More cleanup.
* boot/parser.boot: Likewise.
* boot/translator.boot: Likewise.
Diffstat (limited to 'src/boot/translator.boot')
-rw-r--r-- | src/boot/translator.boot | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/boot/translator.boot b/src/boot/translator.boot index 42e9624f..d172b0ed 100644 --- a/src/boot/translator.boot +++ b/src/boot/translator.boot @@ -404,16 +404,12 @@ translateToplevelExpression expr == $InteractiveMode => expr' shoeEVALANDFILEACTQ expr' -maybeExportDecl(d,export?) == - export? => d - d - translateToplevel(b,export?) == atom b => [b] -- generally happens in interactive mode. - b is ["TUPLE",:xs] => [maybeExportDecl(x,export?) for x in xs] + b is ["DEF",:.] => rest bfCompDef b + b is ["TUPLE",:xs] => coreError '"invalid AST" case b of - %Signature(op,t) => - [maybeExportDecl(genDeclaration(op,t),export?)] + %Signature(op,t) => [genDeclaration(op,t)] %Module(m,ds) => $currentModuleName := m @@ -429,28 +425,33 @@ translateToplevel(b,export?) == %ImportSignature(x, sig) => genImportDeclaration(x, sig) - %TypeAlias(lhs, rhs) => - [maybeExportDecl(genTypeAlias(lhs,rhs),export?)] + %TypeAlias(lhs, rhs) => [genTypeAlias(lhs,rhs)] %ConstantDefinition(lhs,rhs) => sig := nil if lhs is ["%Signature",n,t] then - sig := maybeExportDecl(genDeclaration(n,t),export?) + sig := genDeclaration(n,t) lhs := n - [maybeExportDecl(["DEFCONSTANT",lhs,rhs],export?)] + [["DEFCONSTANT",lhs,rhs]] %Assignment(lhs,rhs) => sig := nil if lhs is ["%Signature",n,t] then - sig := maybeExportDecl(genDeclaration(n,t),export?) + sig := genDeclaration(n,t) lhs := n $InteractiveMode => [["SETF",lhs,rhs]] - [maybeExportDecl(["DEFPARAMETER",lhs,rhs],export?)] + [["DEFPARAMETER",lhs,rhs]] + + %Macro(op,args,body) => bfMDef(op,args,body) + + %Structure(t,alts) => [bfCreateDef alt for alt in alts] %Namespace n => $activeNamespace := STRING n [["IN-PACKAGE",STRING n]] + %Lisp s => shoeReadLispString(s,0) + otherwise => [translateToplevelExpression b] |