diff options
author | dos-reis <gdr@axiomatics.org> | 2012-06-01 05:16:49 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2012-06-01 05:16:49 +0000 |
commit | 04db207b8714da06dd02bdf68163604aeb5e401c (patch) | |
tree | bb179ec45cb023a7876d213e09568a9aa507c213 /src/boot/strap | |
parent | 90b83d54e3238575238a35c2790439c9c56724ce (diff) | |
download | open-axiom-04db207b8714da06dd02bdf68163604aeb5e401c.tar.gz |
* boot/ast.boot (%LoadUnit): Add fields for side conditions.
* boot/parser.boot: Adjust.
Diffstat (limited to 'src/boot/strap')
-rw-r--r-- | src/boot/strap/ast.clisp | 26 | ||||
-rw-r--r-- | src/boot/strap/parser.clisp | 8 | ||||
-rw-r--r-- | src/boot/strap/translator.clisp | 3 |
3 files changed, 21 insertions, 16 deletions
diff --git a/src/boot/strap/ast.clisp b/src/boot/strap/ast.clisp index b3abb36f..ae24d89c 100644 --- a/src/boot/strap/ast.clisp +++ b/src/boot/strap/ast.clisp @@ -151,11 +151,14 @@ |csts| |varno| |letno| - |isno|) + |isno| + |sconds|) -(DEFMACRO |mk%LoadUnit| (|fdefs| |sigs| |xports| |csts| |varno| |letno| |isno|) +(DEFMACRO |mk%LoadUnit| + (|fdefs| |sigs| |xports| |csts| |varno| |letno| |isno| |sconds|) (LIST '|MAKE-%LoadUnit| :|fdefs| |fdefs| :|sigs| |sigs| :|xports| |xports| - :|csts| |csts| :|varno| |varno| :|letno| |letno| :|isno| |isno|)) + :|csts| |csts| :|varno| |varno| :|letno| |letno| :|isno| |isno| + :|sconds| |sconds|)) (DEFMACRO |functionDefinitions| (|bfVar#1|) (LIST '|%LoadUnit-fdefs| |bfVar#1|)) @@ -171,7 +174,9 @@ (DEFMACRO |isVariableNumber| (|bfVar#1|) (LIST '|%LoadUnit-isno| |bfVar#1|)) -(DEFUN |makeLoadUnit| () (|mk%LoadUnit| NIL NIL NIL NIL 0 0 0)) +(DEFMACRO |sideConditions| (|bfVar#1|) (LIST '|%LoadUnit-sconds| |bfVar#1|)) + +(DEFUN |makeLoadUnit| () (|mk%LoadUnit| NIL NIL NIL NIL 0 0 0 NIL)) (DEFUN |pushFunctionDefinition| (|tu| |def|) (SETF (|functionDefinitions| |tu|) (CONS |def| (|functionDefinitions| |tu|)))) @@ -1516,7 +1521,6 @@ (DEFUN |bfMDef| (|tu| |op| |args| |body|) (LET* (|def| |lamex| |argl|) - (DECLARE (SPECIAL |$wheredefs|)) (PROGN (SETQ |argl| (COND ((|bfTupleP| |args|) (CDR |args|)) (T (LIST |args|)))) (SETQ |lamex| (LIST 'MLAMBDA |argl| (|backquote| |body| |argl|))) @@ -1524,7 +1528,7 @@ (CONS (|shoeComp| |def|) (LET ((|bfVar#2| NIL) (|bfVar#3| NIL) - (|bfVar#1| |$wheredefs|) + (|bfVar#1| (|sideConditions| |tu|)) (|d| NIL)) (LOOP (COND @@ -1583,7 +1587,7 @@ (DEFUN |bfDef| (|tu| |op| |args| |body|) (LET* (|body1| |arg1| |op1| |LETTMP#1|) - (DECLARE (SPECIAL |$wheredefs| |$bfClamming|)) + (DECLARE (SPECIAL |$bfClamming|)) (COND (|$bfClamming| (SETQ |LETTMP#1| @@ -1594,7 +1598,8 @@ (|bfTuple| (LET ((|bfVar#2| NIL) (|bfVar#3| NIL) - (|bfVar#1| (CONS (LIST |op| |args| |body|) |$wheredefs|)) + (|bfVar#1| + (CONS (LIST |op| |args| |body|) (|sideConditions| |tu|))) (|d| NIL)) (LOOP (COND @@ -2265,9 +2270,8 @@ (CONS (|bfAlternative| 'T (|bfSequence| |aft|)) NIL))))))))) -(DEFUN |bfWhere| (|context| |expr|) +(DEFUN |bfWhere| (|tu| |context| |expr|) (LET* (|a| |nondefs| |defs| |opassoc| |LETTMP#1|) - (DECLARE (SPECIAL |$wheredefs|)) (PROGN (SETQ |LETTMP#1| (|defSheepAndGoats| |context|)) (SETQ |opassoc| (CAR |LETTMP#1|)) @@ -2289,7 +2293,7 @@ (SETQ |bfVar#3| |bfVar#2|)) (T (RPLACD |bfVar#3| #2#) (SETQ |bfVar#3| (CDR |bfVar#3|)))) (SETQ |bfVar#1| (CDR |bfVar#1|))))) - (SETQ |$wheredefs| (|append| |a| |$wheredefs|)) + (SETF (|sideConditions| |tu|) (|append| |a| (|sideConditions| |tu|))) (|bfMKPROGN| (|bfSUBLIS| |opassoc| (|append!| |nondefs| (LIST |expr|))))))) (DEFUN |bfCompHash| (|tu| |op| |argl| |body|) diff --git a/src/boot/strap/parser.clisp b/src/boot/strap/parser.clisp index cf602e8a..01a10a34 100644 --- a/src/boot/strap/parser.clisp +++ b/src/boot/strap/parser.clisp @@ -1033,10 +1033,10 @@ (T (|bpRestore| |ps| |a|) NIL)))))) (DEFUN |bpStoreName| (|ps|) - (DECLARE (SPECIAL |$typings| |$wheredefs| |$op|)) + (DECLARE (SPECIAL |$typings| |$op|)) (PROGN (SETQ |$op| (CAR (|parserTrees| |ps|))) - (SETQ |$wheredefs| NIL) + (SETF (|sideConditions| (|parserLoadUnit| |ps|)) NIL) (SETQ |$typings| NIL) T)) @@ -1066,7 +1066,9 @@ (AND (|bpDefinition| |ps|) (OR (AND (|bpEqKey| |ps| 'WHERE) (|bpRequire| |ps| #'|bpDefinitionItem|) - (|bpPush| |ps| (|bfWhere| (|bpPop1| |ps|) (|bpPop1| |ps|)))) + (|bpPush| |ps| + (|bfWhere| (|parserLoadUnit| |ps|) (|bpPop1| |ps|) + (|bpPop1| |ps|)))) T))) (DEFUN |bpDefinitionItem| (|ps|) diff --git a/src/boot/strap/translator.clisp b/src/boot/strap/translator.clisp index 675bd292..afe93b70 100644 --- a/src/boot/strap/translator.clisp +++ b/src/boot/strap/translator.clisp @@ -433,11 +433,10 @@ (DEFUN |shoeOutParse| (|toks|) (LET* (|found| |ps|) - (DECLARE (SPECIAL |$returns| |$typings| |$wheredefs| |$op|)) + (DECLARE (SPECIAL |$returns| |$typings| |$op|)) (PROGN (SETQ |ps| (|makeParserState| |toks|)) (SETQ |$op| NIL) - (SETQ |$wheredefs| NIL) (SETQ |$typings| NIL) (SETQ |$returns| NIL) (|bpFirstTok| |ps|) |