aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog26
-rw-r--r--src/doc/msgs/s2-us.msgs2
-rw-r--r--src/interp/i-intern.boot1
-rw-r--r--src/interp/i-spec1.boot2
-rw-r--r--src/interp/i-spec2.boot29
-rw-r--r--src/interp/pf2sex.boot21
-rw-r--r--src/interp/ptrees.boot1
7 files changed, 73 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 54c3a9a8..bb01b873 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,31 @@
2008-08-09 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/pf2sex.boot (pf2Sex1): Handle more ASTs.
+ (pfType2SexOrNil): New.
+ (pfDoc2SexOrNil): Likewise.
+ (pfWith2Sex): Likewise.
+ (pfAdd2Sex): Likewise.
+ (pfWDeclare2Sex): Likewise.
+ (pfAttribute2Sex): Likewise.
+ (pfWIf2Sex): Likewise.
+ (pfExport2Sex): Likewise.
+ (pfInline2Sex): Likewise.
+ (pfImport2Sex): Likewise.
+ (pfQualType2Sex): Likewise.
+ * interp/ptrees.boot (pf0InlineItems): New.
+ * interp/i-spec2.boot (up%Import): New.
+ (sorry): Likewise.
+ (up%Export): Likewise.
+ (up%Inline): Likewise.
+ (up%With): Likewise.
+ (up%Add): Likewise.
+ * interp/i-intern.boot (mkAtree3): Handle %Inline, %With, %Add,
+ and %Export.
+ * interp/i-spec1.boot ($specialOps): Adjust.
+ * doc/msgs/s2-us.msgs (S2IP0006): New.
+
+2008-08-09 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* include/open-axiom.h (OPENAXIOM_HAVE_GRAPHICS): Define.
* sman/sman.c (process_arguments): Use it.
(process_arguments): Likewise.
diff --git a/src/doc/msgs/s2-us.msgs b/src/doc/msgs/s2-us.msgs
index ed450680..ec7bdccc 100644
--- a/src/doc/msgs/s2-us.msgs
+++ b/src/doc/msgs/s2-us.msgs
@@ -414,6 +414,8 @@ S2IP0004
%1 macro %2b .
S2IP0005
%1b is not a valid identifier to use in OpenAxiom.
+S2IP0006
+ Sorry, %1b is not handled in the interpreter yet. Try the compiler.
S2IR0001
Cannot resolve all the types in the list to be created.
S2IR0002
diff --git a/src/interp/i-intern.boot b/src/interp/i-intern.boot
index 681464a6..055fc160 100644
--- a/src/interp/i-intern.boot
+++ b/src/interp/i-intern.boot
@@ -251,6 +251,7 @@ mkAtree3(x,op,argl) ==
[mkAtreeNode 'DEF,[[op,:v.0],:r],if v.2 then v.2 else true,false]
[mkAtreeNode 'DEF,[a,:r],true,false]
op="[||]" => [mkAtreeNode op, :argl]
+ op in '(%Inline %With %Add %Export) => [mkAtreeNode op,:argl]
--x is ['when,y,pred] =>
-- y isnt ['DEF,a,:r] =>
-- keyedSystemError("S2II0003",['"when",y,'"improper argument form"])
diff --git a/src/interp/i-spec1.boot b/src/interp/i-spec1.boot
index 1540cd68..9ad10e05 100644
--- a/src/interp/i-spec1.boot
+++ b/src/interp/i-spec1.boot
@@ -42,7 +42,7 @@ $specialOps := '(
ADEF AlgExtension _and _case COERCE COLLECT construct Declare DEF Dollar
equation error free has IF _is _isnt iterate _break %LET _local MDEF _or
pretend QUOTE REDUCE REPEAT _return SEQ TARGET tuple typeOf _where
- _[_|_|_] %Macro %MLambda)
+ _[_|_|_] %Macro %MLambda %Import %Export %Inline %With %Add)
$repeatLabel := NIL
$breakCount := 0
diff --git a/src/interp/i-spec2.boot b/src/interp/i-spec2.boot
index f8c2ab27..e78da954 100644
--- a/src/interp/i-spec2.boot
+++ b/src/interp/i-spec2.boot
@@ -1160,6 +1160,14 @@ copyHack(env) ==
CONS(CAR p,[(EQCAR(q,'localModemap) => q; copy q) for q in CDR p])
[[d]]
+--% importing domains
+up%Import t ==
+ t isnt [.,:types] => nil
+ -- ??? shall we error in case types is nil?
+ for x in types repeat
+ $e := addDomain(devaluate objVal getValue x,$e)
+ setValueToVoid t
+
--% Macro handling
-- Well, in fact we never handle macros in the interpreter directly.
@@ -1173,6 +1181,27 @@ up%Macro t ==
up%MLambda t ==
setValueToVoid t
+
+--% Sorry for unhandled input constructs
+sorry kind ==
+ throwKeyedMsg("S2IP0006",[kind])
+
+--% Export
+up%Export t ==
+ sorry '"export declaration"
+
+--% Inline
+up%Inline t ==
+ sorry '"inline declaration"
+
+--% Category
+up%With t ==
+ sorry '"category definition"
+
+--% Domain
+up%Add t ==
+ sorry '"domain definition"
+
-- Creates the function names of the special function handlers and puts
-- them on the property list of the function name
diff --git a/src/interp/pf2sex.boot b/src/interp/pf2sex.boot
index 77c04c83..9da4d3b4 100644
--- a/src/interp/pf2sex.boot
+++ b/src/interp/pf2sex.boot
@@ -495,19 +495,25 @@ pfMLambda2Sex pf ==
pfType2SexOrNil pf ==
- pfNohting? pf => nil
+ pfNothing? pf => nil
+ pf2Sex1 pf
+
+pfDoc2SexOrNil pf ==
+ pfNothing? pf => nil
pf2Sex1 pf
pfWith2Sex pf ==
- ["%With", pf2Sex1 pfWithBase, pf2Sex1 pfWithWithin pf,
- pf2Sex1 pf2Sex1 pfWithWithon pf]
+ ["%With", pfType2SexOrNil pfWithBase pf,
+ [pf2Sex1 s for s in pf0WithWithin pf],
+ pfType2SexOrNil pfWithWithon pf]
pfAdd2Sex pf ==
["%Add", pf2Sex1 pfAddBase pf, pf2Sex1 pfAddAddin pf,
pfType2SexOrNil pfAddAddon pf]
pfWDeclare2Sex pf ==
- ["%Declare", pf2Sex1 pfWDeclareSignature pf, pf2Sex1 pfWDeclareDoc pf]
+ ["%Signature", rest pf2Sex1 pfWDeclareSignature pf,
+ pfDoc2SexOrNil pfWDeclareDoc pf]
pfAttribute2Sex pf ==
["%Attribute", pf2Sex1 pfAttributeExpr pf]
@@ -523,9 +529,8 @@ pfImport2Sex pf ==
["%Import", :[pf2Sex1 item for item in pf0ImportItems pf]]
pfInline2Sex pf ==
- ["%Inline", :[pf2Sex1 item for item in pfInlineItems pf]]
+ ["%Inline", :[pf2Sex1 item for item in pf0InlineItems pf]]
pfQualType2Sex pf ==
- ["%QualType", pf2Sex1 pfQyalTypeType pf,
- pfType2SexOrNil pfQualTypeQual pf]
-
+ -- pfQualTypeQual is always nothing.
+ pf2Sex1 pfQualTypeType pf
diff --git a/src/interp/ptrees.boot b/src/interp/ptrees.boot
index ed40c466..3ddc9d96 100644
--- a/src/interp/ptrees.boot
+++ b/src/interp/ptrees.boot
@@ -638,6 +638,7 @@ pf0ImportItems pf == pfParts pfImportItems pf
pfInline(pfitems) == pfTree('Inline, [pfitems])
pfInline?(pf) == pfAbSynOp? (pf, 'Inline)
pfInlineItems pf == second pf -- was ==>
+pf0InlineItems pf == pfParts pfInlineItems pf
-- QualType := (Type: Type, Qual: ? Type)