aboutsummaryrefslogtreecommitdiff
path: root/src/boot/strap
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2012-05-30 01:29:11 +0000
committerdos-reis <gdr@axiomatics.org>2012-05-30 01:29:11 +0000
commitf41afae2b242dd56e8dbfa0b3f8cb16a6ab29ff0 (patch)
tree965cfaa10f1e8b18138765e758773eb026cd5515 /src/boot/strap
parent6c9b37fd68b558bced11d67cfc798ca96800bc79 (diff)
downloadopen-axiom-f41afae2b242dd56e8dbfa0b3f8cb16a6ab29ff0.tar.gz
* boot/parser.boot: Add parser state argument to more functions.
Remove references to $inputStream. * boot/translator.boot (shoeOutParse): Remove $inputStream.
Diffstat (limited to 'src/boot/strap')
-rw-r--r--src/boot/strap/parser.clisp670
-rw-r--r--src/boot/strap/translator.clisp2
2 files changed, 360 insertions, 312 deletions
diff --git a/src/boot/strap/parser.clisp b/src/boot/strap/parser.clisp
index e876b3ba..ded828e4 100644
--- a/src/boot/strap/parser.clisp
+++ b/src/boot/strap/parser.clisp
@@ -53,7 +53,7 @@
(DEFUN |makeTranslator| (|ip|) (|mk%Translator| |ip| NIL NIL NIL NIL))
-(DEFUN |bpFirstToken| ()
+(DEFUN |bpFirstToken| (|ps|)
(DECLARE (SPECIAL |$ttok| |$stok| |$inputStream|))
(PROGN
(SETQ |$stok|
@@ -64,7 +64,7 @@
(SETQ |$ttok| (|tokenValue| |$stok|))
T))
-(DEFUN |bpFirstTok| ()
+(DEFUN |bpFirstTok| (|ps|)
(DECLARE (SPECIAL |$bpCount| |$bpParenCount| |$ttok| |$stok| |$inputStream|))
(PROGN
(SETQ |$stok|
@@ -75,31 +75,32 @@
(SETQ |$ttok| (|tokenValue| |$stok|))
(COND
((AND (PLUSP |$bpParenCount|) (EQ (|tokenClass| |$stok|) 'KEY))
- (COND ((EQ |$ttok| 'SETTAB) (SETQ |$bpCount| (+ |$bpCount| 1)) (|bpNext|))
- ((EQ |$ttok| 'BACKTAB) (SETQ |$bpCount| (- |$bpCount| 1))
- (|bpNext|))
- ((EQ |$ttok| 'BACKSET) (|bpNext|)) (T T)))
+ (COND
+ ((EQ |$ttok| 'SETTAB) (SETQ |$bpCount| (+ |$bpCount| 1)) (|bpNext| |ps|))
+ ((EQ |$ttok| 'BACKTAB) (SETQ |$bpCount| (- |$bpCount| 1))
+ (|bpNext| |ps|))
+ ((EQ |$ttok| 'BACKSET) (|bpNext| |ps|)) (T T)))
(T T))))
-(DEFUN |bpNext| ()
+(DEFUN |bpNext| (|ps|)
(DECLARE (SPECIAL |$inputStream|))
- (PROGN (SETQ |$inputStream| (CDR |$inputStream|)) (|bpFirstTok|)))
+ (PROGN (SETQ |$inputStream| (CDR |$inputStream|)) (|bpFirstTok| |ps|)))
-(DEFUN |bpNextToken| ()
+(DEFUN |bpNextToken| (|ps|)
(DECLARE (SPECIAL |$inputStream|))
- (PROGN (SETQ |$inputStream| (CDR |$inputStream|)) (|bpFirstToken|)))
+ (PROGN (SETQ |$inputStream| (CDR |$inputStream|)) (|bpFirstToken| |ps|)))
(DEFUN |bpRequire| (|ps| |f|) (OR (APPLY |f| |ps| NIL) (|bpTrap|)))
-(DEFUN |bpState| ()
+(DEFUN |bpState| (|ps|)
(DECLARE (SPECIAL |$bpCount| |$bpParenCount| |$stack| |$inputStream|))
(LIST |$inputStream| |$stack| |$bpParenCount| |$bpCount|))
-(DEFUN |bpRestore| (|x|)
+(DEFUN |bpRestore| (|ps| |x|)
(DECLARE (SPECIAL |$bpCount| |$bpParenCount| |$stack| |$inputStream|))
(PROGN
(SETQ |$inputStream| (CAR |x|))
- (|bpFirstToken|)
+ (|bpFirstToken| |ps|)
(SETQ |$stack| (CADR |x|))
(SETQ |$bpParenCount| (CADDR |x|))
(SETQ |$bpCount| (CADDDR |x|))
@@ -113,17 +114,17 @@
(DECLARE (SPECIAL |$stack| |$ttok|))
(SETQ |$stack| (CONS (|bfReName| |$ttok|) |$stack|)))
-(DEFUN |bpPop1| ()
+(DEFUN |bpPop1| (|ps|)
(LET* (|a|)
(DECLARE (SPECIAL |$stack|))
(PROGN (SETQ |a| (CAR |$stack|)) (SETQ |$stack| (CDR |$stack|)) |a|)))
-(DEFUN |bpPop2| ()
+(DEFUN |bpPop2| (|ps|)
(LET* (|a|)
(DECLARE (SPECIAL |$stack|))
(PROGN (SETQ |a| (CADR |$stack|)) (RPLACD |$stack| (CDDR |$stack|)) |a|)))
-(DEFUN |bpPop3| ()
+(DEFUN |bpPop3| (|ps|)
(LET* (|a|)
(DECLARE (SPECIAL |$stack|))
(PROGN
@@ -140,19 +141,19 @@
(SETQ |a| |$stok|)
(COND
((|bpEqPeek| 'OPAREN) (SETQ |$bpParenCount| (+ |$bpParenCount| 1))
- (|bpNext|)
+ (|bpNext| |ps|)
(COND
- ((AND (APPLY |f| |ps| NIL) (|bpFirstTok|)
+ ((AND (APPLY |f| |ps| NIL) (|bpFirstTok| |ps|)
(OR (|bpEqPeek| 'CPAREN) (|bpParenTrap| |a|)))
- (SETQ |$bpParenCount| (- |$bpParenCount| 1)) (|bpNextToken|)
+ (SETQ |$bpParenCount| (- |$bpParenCount| 1)) (|bpNextToken| |ps|)
(COND ((EQL |$bpCount| 0) T)
(T
(SETQ |$inputStream|
(|append| (|bpAddTokens| |$bpCount|) |$inputStream|))
- (|bpFirstToken|)
- (COND ((EQL |$bpParenCount| 0) (|bpCancel|) T) (T T)))))
+ (|bpFirstToken| |ps|)
+ (COND ((EQL |$bpParenCount| 0) (|bpCancel| |ps|) T) (T T)))))
((|bpEqPeek| 'CPAREN) (|bpPush| |ps| (|bfTuple| NIL))
- (SETQ |$bpParenCount| (- |$bpParenCount| 1)) (|bpNextToken|) T)
+ (SETQ |$bpParenCount| (- |$bpParenCount| 1)) (|bpNextToken| |ps|) T)
(T (|bpParenTrap| |a|))))
(T NIL))))))
@@ -162,12 +163,12 @@
(PROGN
(SETQ |a| |$stok|)
(COND
- ((|bpEqKey| 'OPAREN)
+ ((|bpEqKey| |ps| 'OPAREN)
(COND
((AND (APPLY |f| |ps| NIL)
- (OR (|bpEqKey| 'CPAREN) (|bpParenTrap| |a|)))
+ (OR (|bpEqKey| |ps| 'CPAREN) (|bpParenTrap| |a|)))
T)
- ((|bpEqKey| 'CPAREN) (|bpPush| |ps| (|bfTuple| NIL)) T)
+ ((|bpEqKey| |ps| 'CPAREN) (|bpPush| |ps| (|bfTuple| NIL)) T)
(T (|bpParenTrap| |a|))))
(T NIL)))))
@@ -177,20 +178,22 @@
(PROGN
(SETQ |a| |$stok|)
(COND
- ((|bpEqKey| 'OBRACK)
+ ((|bpEqKey| |ps| 'OBRACK)
(COND
((AND (APPLY |f| |ps| NIL)
- (OR (|bpEqKey| 'CBRACK) (|bpBrackTrap| |a|)))
- (|bpPush| |ps| (|bfBracket| (|bpPop1|))))
- ((|bpEqKey| 'CBRACK) (|bpPush| |ps| NIL)) (T (|bpBrackTrap| |a|))))
+ (OR (|bpEqKey| |ps| 'CBRACK) (|bpBrackTrap| |a|)))
+ (|bpPush| |ps| (|bfBracket| (|bpPop1| |ps|))))
+ ((|bpEqKey| |ps| 'CBRACK) (|bpPush| |ps| NIL))
+ (T (|bpBrackTrap| |a|))))
(T NIL)))))
(DEFUN |bpPileBracketed| (|ps| |f|)
(COND
- ((|bpEqKey| 'SETTAB)
- (COND ((|bpEqKey| 'BACKTAB) T)
- ((AND (APPLY |f| |ps| NIL) (OR (|bpEqKey| 'BACKTAB) (|bpPileTrap|)))
- (|bpPush| |ps| (|bfPile| (|bpPop1|))))
+ ((|bpEqKey| |ps| 'SETTAB)
+ (COND ((|bpEqKey| |ps| 'BACKTAB) T)
+ ((AND (APPLY |f| |ps| NIL)
+ (OR (|bpEqKey| |ps| 'BACKTAB) (|bpPileTrap|)))
+ (|bpPush| |ps| (|bfPile| (|bpPop1| |ps|))))
(T NIL)))
(T NIL)))
@@ -200,16 +203,18 @@
(COND
((APPLY |f| |ps| NIL)
(COND
- ((AND (|bpEqKey| |str1|) (|bpRequire| |ps| |f|)) (SETQ |a| |$stack|)
- (SETQ |$stack| NIL)
+ ((AND (|bpEqKey| |ps| |str1|) (|bpRequire| |ps| |f|))
+ (SETQ |a| |$stack|) (SETQ |$stack| NIL)
(LOOP
(COND
- ((NOT (AND (|bpEqKey| |str1|) (|bpRequire| |ps| |f|))) (RETURN NIL))
+ ((NOT (AND (|bpEqKey| |ps| |str1|) (|bpRequire| |ps| |f|)))
+ (RETURN NIL))
(T NIL)))
(SETQ |$stack| (CONS (|reverse!| |$stack|) |a|))
(|bpPush| |ps|
(FUNCALL |g|
- (CONS (|bpPop3|) (CONS (|bpPop2|) (|bpPop1|))))))
+ (CONS (|bpPop3| |ps|)
+ (CONS (|bpPop2| |ps|) (|bpPop1| |ps|))))))
(T T)))
(T NIL))))
@@ -229,7 +234,8 @@
(SETQ |$stack| (CONS (|reverse!| |$stack|) |a|))
(|bpPush| |ps|
(FUNCALL |g|
- (CONS (|bpPop3|) (CONS (|bpPop2|) (|bpPop1|))))))
+ (CONS (|bpPop3| |ps|)
+ (CONS (|bpPop2| |ps|) (|bpPop1| |ps|))))))
(T T)))
(T NIL))))
@@ -239,15 +245,18 @@
(COND
((APPLY |f| |ps| NIL)
(COND
- ((AND (|bpEqKey| |str1|) (|bpRequire| |ps| |f|)) (SETQ |a| |$stack|)
- (SETQ |$stack| NIL)
+ ((AND (|bpEqKey| |ps| |str1|) (|bpRequire| |ps| |f|))
+ (SETQ |a| |$stack|) (SETQ |$stack| NIL)
(LOOP
(COND
- ((NOT (AND (|bpEqKey| |str1|) (|bpRequire| |ps| |f|))) (RETURN NIL))
+ ((NOT (AND (|bpEqKey| |ps| |str1|) (|bpRequire| |ps| |f|)))
+ (RETURN NIL))
(T NIL)))
(SETQ |$stack| (CONS (|reverse!| |$stack|) |a|))
- (|bpPush| |ps| (CONS (|bpPop3|) (CONS (|bpPop2|) (|bpPop1|)))))
- (T (|bpPush| |ps| (LIST (|bpPop1|))))))
+ (|bpPush| |ps|
+ (CONS (|bpPop3| |ps|)
+ (CONS (|bpPop2| |ps|) (|bpPop1| |ps|)))))
+ (T (|bpPush| |ps| (LIST (|bpPop1| |ps|))))))
(T (|bpPush| |ps| NIL)))))
(DEFUN |bpOneOrMore| (|ps| |f|)
@@ -257,55 +266,59 @@
((APPLY |f| |ps| NIL) (SETQ |a| |$stack|) (SETQ |$stack| NIL)
(LOOP (COND ((NOT (APPLY |f| |ps| NIL)) (RETURN NIL)) (T NIL)))
(SETQ |$stack| (CONS (|reverse!| |$stack|) |a|))
- (|bpPush| |ps| (CONS (|bpPop2|) (|bpPop1|))))
+ (|bpPush| |ps| (CONS (|bpPop2| |ps|) (|bpPop1| |ps|))))
(T NIL))))
(DEFUN |bpAnyNo| (|ps| |s|)
(PROGN (LOOP (COND ((NOT (APPLY |s| |ps| NIL)) (RETURN NIL)) (T NIL))) T))
(DEFUN |bpAndOr| (|ps| |keyword| |p| |f|)
- (AND (|bpEqKey| |keyword|) (|bpRequire| |ps| |p|)
- (|bpPush| |ps| (FUNCALL |f| (|bpPop1|)))))
+ (AND (|bpEqKey| |ps| |keyword|) (|bpRequire| |ps| |p|)
+ (|bpPush| |ps| (FUNCALL |f| (|bpPop1| |ps|)))))
(DEFUN |bpConditional| (|ps| |f|)
(COND
- ((AND (|bpEqKey| 'IF) (|bpRequire| |ps| #'|bpWhere|)
- (OR (|bpEqKey| 'BACKSET) T))
+ ((AND (|bpEqKey| |ps| 'IF) (|bpRequire| |ps| #'|bpWhere|)
+ (OR (|bpEqKey| |ps| 'BACKSET) T))
(COND
- ((|bpEqKey| 'SETTAB)
+ ((|bpEqKey| |ps| 'SETTAB)
(COND
- ((|bpEqKey| 'THEN)
- (AND (|bpRequire| |ps| |f|) (|bpElse| |ps| |f|) (|bpEqKey| 'BACKTAB)))
+ ((|bpEqKey| |ps| 'THEN)
+ (AND (|bpRequire| |ps| |f|) (|bpElse| |ps| |f|)
+ (|bpEqKey| |ps| 'BACKTAB)))
(T (|bpMissing| 'THEN))))
- ((|bpEqKey| 'THEN) (AND (|bpRequire| |ps| |f|) (|bpElse| |ps| |f|)))
+ ((|bpEqKey| |ps| 'THEN) (AND (|bpRequire| |ps| |f|) (|bpElse| |ps| |f|)))
(T (|bpMissing| '|then|))))
(T NIL)))
(DEFUN |bpElse| (|ps| |f|)
(LET* (|a|)
(PROGN
- (SETQ |a| (|bpState|))
+ (SETQ |a| (|bpState| |ps|))
(COND
- ((|bpBacksetElse|)
+ ((|bpBacksetElse| |ps|)
(AND (|bpRequire| |ps| |f|)
- (|bpPush| |ps| (|bfIf| (|bpPop3|) (|bpPop2|) (|bpPop1|)))))
- (T (|bpRestore| |a|)
- (|bpPush| |ps| (|bfIfThenOnly| (|bpPop2|) (|bpPop1|))))))))
+ (|bpPush| |ps|
+ (|bfIf| (|bpPop3| |ps|) (|bpPop2| |ps|)
+ (|bpPop1| |ps|)))))
+ (T (|bpRestore| |ps| |a|)
+ (|bpPush| |ps| (|bfIfThenOnly| (|bpPop2| |ps|) (|bpPop1| |ps|))))))))
-(DEFUN |bpBacksetElse| ()
- (COND ((|bpEqKey| 'BACKSET) (|bpEqKey| 'ELSE)) (T (|bpEqKey| 'ELSE))))
+(DEFUN |bpBacksetElse| (|ps|)
+ (COND ((|bpEqKey| |ps| 'BACKSET) (|bpEqKey| |ps| 'ELSE))
+ (T (|bpEqKey| |ps| 'ELSE))))
(DEFUN |bpEqPeek| (|s|)
(DECLARE (SPECIAL |$ttok| |$stok|))
(AND (EQ (|tokenClass| |$stok|) 'KEY) (EQ |s| |$ttok|)))
-(DEFUN |bpEqKey| (|s|)
+(DEFUN |bpEqKey| (|ps| |s|)
(DECLARE (SPECIAL |$ttok| |$stok|))
- (AND (EQ (|tokenClass| |$stok|) 'KEY) (EQ |s| |$ttok|) (|bpNext|)))
+ (AND (EQ (|tokenClass| |$stok|) 'KEY) (EQ |s| |$ttok|) (|bpNext| |ps|)))
-(DEFUN |bpEqKeyNextTok| (|s|)
+(DEFUN |bpEqKeyNextTok| (|ps| |s|)
(DECLARE (SPECIAL |$ttok| |$stok|))
- (AND (EQ (|tokenClass| |$stok|) 'KEY) (EQ |s| |$ttok|) (|bpNextToken|)))
+ (AND (EQ (|tokenClass| |$stok|) 'KEY) (EQ |s| |$ttok|) (|bpNextToken| |ps|)))
(DEFUN |bpPileTrap| () (|bpMissing| 'BACKTAB))
@@ -324,7 +337,7 @@
(THROW :OPEN-AXIOM-CATCH-POINT
(CONS :OPEN-AXIOM-CATCH-POINT (CONS '(|BootParserException|) 'TRAPPED)))))
-(DEFUN |bpCompMissing| (|s|) (OR (|bpEqKey| |s|) (|bpMissing| |s|)))
+(DEFUN |bpCompMissing| (|ps| |s|) (OR (|bpEqKey| |ps| |s|) (|bpMissing| |s|)))
(DEFUN |bpTrap| ()
(PROGN
@@ -336,9 +349,9 @@
(LET* (|pos2| |pos1|)
(DECLARE (SPECIAL |$stok|))
(PROGN
- (|bpFirstToken|)
+ (|bpFirstToken| |ps|)
(SETQ |pos1| (|tokenPosition| |$stok|))
- (|bpMoveTo| 0)
+ (|bpMoveTo| |ps| 0)
(SETQ |pos2| (|tokenPosition| |$stok|))
(|bpIgnoredFromTo| |pos1| |pos2|)
(|bpPush| |ps| (LIST (LIST "pile syntax error"))))))
@@ -373,7 +386,7 @@
(|bpRecoverTrap| |ps|))
((NOT |found|) (SETQ |$inputStream| |c|) (|bpGeneralErrorHere|)
(|bpRecoverTrap| |ps|)))
- (COND ((|bpEqKey| 'BACKSET) (SETQ |c| |$inputStream|))
+ (COND ((|bpEqKey| |ps| 'BACKSET) (SETQ |c| |$inputStream|))
((OR (|bpEqPeek| 'BACKTAB) (NULL |$inputStream|))
(SETQ |done| T))
(T (SETQ |$inputStream| |c|) (|bpGeneralErrorHere|)
@@ -381,39 +394,39 @@
(COND
((OR (|bpEqPeek| 'BACKTAB) (NULL |$inputStream|))
(SETQ |done| T))
- (T (|bpNext|) (SETQ |c| |$inputStream|)))))
- (SETQ |b| (CONS (|bpPop1|) |b|)))))
+ (T (|bpNext| |ps|) (SETQ |c| |$inputStream|)))))
+ (SETQ |b| (CONS (|bpPop1| |ps|) |b|)))))
(SETQ |$stack| |a|)
(|bpPush| |ps| (|reverse!| |b|)))))
-(DEFUN |bpMoveTo| (|n|)
+(DEFUN |bpMoveTo| (|ps| |n|)
(DECLARE (SPECIAL |$bpParenCount| |$bpCount| |$inputStream|))
(COND ((NULL |$inputStream|) T)
((|bpEqPeek| 'BACKTAB)
(COND ((EQL |n| 0) T)
- (T (|bpNextToken|) (SETQ |$bpCount| (- |$bpCount| 1))
- (|bpMoveTo| (- |n| 1)))))
+ (T (|bpNextToken| |ps|) (SETQ |$bpCount| (- |$bpCount| 1))
+ (|bpMoveTo| |ps| (- |n| 1)))))
((|bpEqPeek| 'BACKSET)
- (COND ((EQL |n| 0) T) (T (|bpNextToken|) (|bpMoveTo| |n|))))
- ((|bpEqPeek| 'SETTAB) (|bpNextToken|) (|bpMoveTo| (+ |n| 1)))
- ((|bpEqPeek| 'OPAREN) (|bpNextToken|)
- (SETQ |$bpParenCount| (+ |$bpParenCount| 1)) (|bpMoveTo| |n|))
- ((|bpEqPeek| 'CPAREN) (|bpNextToken|)
- (SETQ |$bpParenCount| (- |$bpParenCount| 1)) (|bpMoveTo| |n|))
- (T (|bpNextToken|) (|bpMoveTo| |n|))))
+ (COND ((EQL |n| 0) T) (T (|bpNextToken| |ps|) (|bpMoveTo| |ps| |n|))))
+ ((|bpEqPeek| 'SETTAB) (|bpNextToken| |ps|) (|bpMoveTo| |ps| (+ |n| 1)))
+ ((|bpEqPeek| 'OPAREN) (|bpNextToken| |ps|)
+ (SETQ |$bpParenCount| (+ |$bpParenCount| 1)) (|bpMoveTo| |ps| |n|))
+ ((|bpEqPeek| 'CPAREN) (|bpNextToken| |ps|)
+ (SETQ |$bpParenCount| (- |$bpParenCount| 1)) (|bpMoveTo| |ps| |n|))
+ (T (|bpNextToken| |ps|) (|bpMoveTo| |ps| |n|))))
(DEFUN |bpQualifiedName| (|ps|)
(DECLARE (SPECIAL |$stok|))
(COND
- ((|bpEqPeek| 'COLON-COLON) (|bpNext|)
- (AND (EQ (|tokenClass| |$stok|) 'ID) (|bpPushId| |ps|) (|bpNext|)
- (|bpPush| |ps| (|bfColonColon| (|bpPop2|) (|bpPop1|)))))
+ ((|bpEqPeek| 'COLON-COLON) (|bpNext| |ps|)
+ (AND (EQ (|tokenClass| |$stok|) 'ID) (|bpPushId| |ps|) (|bpNext| |ps|)
+ (|bpPush| |ps| (|bfColonColon| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(T NIL)))
(DEFUN |bpName| (|ps|)
(DECLARE (SPECIAL |$stok|))
(COND
- ((EQ (|tokenClass| |$stok|) 'ID) (|bpPushId| |ps|) (|bpNext|)
+ ((EQ (|tokenClass| |$stok|) 'ID) (|bpPushId| |ps|) (|bpNext| |ps|)
(|bpAnyNo| |ps| #'|bpQualifiedName|))
(T NIL)))
@@ -421,16 +434,16 @@
(DECLARE (SPECIAL |$ttok| |$stok|))
(COND
((|symbolMember?| (|tokenClass| |$stok|) '(INTEGER FLOAT))
- (|bpPush| |ps| |$ttok|) (|bpNext|))
+ (|bpPush| |ps| |$ttok|) (|bpNext| |ps|))
((EQ (|tokenClass| |$stok|) 'LISP)
- (AND (|bpPush| |ps| (|%Lisp| |$ttok|)) (|bpNext|)))
+ (AND (|bpPush| |ps| (|%Lisp| |$ttok|)) (|bpNext| |ps|)))
((EQ (|tokenClass| |$stok|) 'LISPEXP)
- (AND (|bpPush| |ps| |$ttok|) (|bpNext|)))
+ (AND (|bpPush| |ps| |$ttok|) (|bpNext| |ps|)))
((EQ (|tokenClass| |$stok|) 'LINE)
- (AND (|bpPush| |ps| (LIST '+LINE |$ttok|)) (|bpNext|)))
- ((|bpEqPeek| 'QUOTE) (|bpNext|)
+ (AND (|bpPush| |ps| (LIST '+LINE |$ttok|)) (|bpNext| |ps|)))
+ ((|bpEqPeek| 'QUOTE) (|bpNext| |ps|)
(AND (|bpRequire| |ps| #'|bpSexp|)
- (|bpPush| |ps| (|bfSymbol| (|bpPop1|)))))
+ (|bpPush| |ps| (|bfSymbol| (|bpPop1| |ps|)))))
(T (OR (|bpString| |ps|) (|bpFunction| |ps|)))))
(DEFUN |bpChar| (|ps|)
@@ -438,117 +451,124 @@
(DECLARE (SPECIAL |$ttok| |$stok|))
(COND
((AND (EQ (|tokenClass| |$stok|) 'ID) (EQ |$ttok| '|char|))
- (SETQ |a| (|bpState|))
+ (SETQ |a| (|bpState| |ps|))
(COND
- ((|bpApplication| |ps|) (SETQ |s| (|bpPop1|))
+ ((|bpApplication| |ps|) (SETQ |s| (|bpPop1| |ps|))
(COND
((AND (CONSP |s|) (EQ (CAR |s|) '|char|)
(PROGN
(SETQ |ISTMP#1| (CDR |s|))
(AND (CONSP |ISTMP#1|) (NULL (CDR |ISTMP#1|)))))
(|bpPush| |ps| |s|))
- (T (|bpRestore| |a|) NIL)))
+ (T (|bpRestore| |ps| |a|) NIL)))
(T NIL)))
(T NIL))))
(DEFUN |bpExportItemTail| (|ps|)
(OR
- (AND (|bpEqKey| 'BEC) (|bpRequire| |ps| #'|bpAssign|)
- (|bpPush| |ps| (|%Assignment| (|bpPop2|) (|bpPop1|))))
+ (AND (|bpEqKey| |ps| 'BEC) (|bpRequire| |ps| #'|bpAssign|)
+ (|bpPush| |ps| (|%Assignment| (|bpPop2| |ps|) (|bpPop1| |ps|))))
(|bpSimpleDefinitionTail| |ps|)))
(DEFUN |bpExportItem| (|ps|)
(LET* (|a|)
(COND ((|bpEqPeek| 'STRUCTURE) (|bpStruct| |ps|))
- (T (SETQ |a| (|bpState|))
+ (T (SETQ |a| (|bpState| |ps|))
(COND
((|bpName| |ps|)
(COND
- ((|bpEqPeek| 'COLON) (|bpRestore| |a|)
+ ((|bpEqPeek| 'COLON) (|bpRestore| |ps| |a|)
(|bpRequire| |ps| #'|bpSignature|)
(OR (|bpExportItemTail| |ps|) T))
- (T (|bpRestore| |a|) (|bpTypeAliasDefition| |ps|))))
+ (T (|bpRestore| |ps| |a|) (|bpTypeAliasDefition| |ps|))))
(T NIL))))))
(DEFUN |bpExportItemList| (|ps|) (|bpListAndRecover| |ps| #'|bpExportItem|))
(DEFUN |bpModuleInterface| (|ps|)
(COND
- ((|bpEqKey| 'WHERE)
+ ((|bpEqKey| |ps| 'WHERE)
(OR (|bpPileBracketed| |ps| #'|bpExportItemList|)
- (AND (|bpExportItem| |ps|) (|bpPush| |ps| (LIST (|bpPop1|))))
+ (AND (|bpExportItem| |ps|) (|bpPush| |ps| (LIST (|bpPop1| |ps|))))
(|bpTrap|)))
(T (|bpPush| |ps| NIL))))
(DEFUN |bpModuleExports| (|ps|)
(COND
((|bpParenthesized| |ps| #'|bpIdList|)
- (|bpPush| |ps| (|bfUntuple| (|bpPop1|))))
+ (|bpPush| |ps| (|bfUntuple| (|bpPop1| |ps|))))
(T (|bpPush| |ps| NIL))))
(DEFUN |bpModule| (|ps|)
(COND
- ((|bpEqKey| 'MODULE) (|bpRequire| |ps| #'|bpName|) (|bpModuleExports| |ps|)
- (|bpModuleInterface| |ps|)
- (|bpPush| |ps| (|%Module| (|bpPop3|) (|bpPop2|) (|bpPop1|))))
+ ((|bpEqKey| |ps| 'MODULE) (|bpRequire| |ps| #'|bpName|)
+ (|bpModuleExports| |ps|) (|bpModuleInterface| |ps|)
+ (|bpPush| |ps|
+ (|%Module| (|bpPop3| |ps|) (|bpPop2| |ps|) (|bpPop1| |ps|))))
(T NIL)))
(DEFUN |bpImport| (|ps|)
(LET* (|a|)
(COND
- ((|bpEqKey| 'IMPORT)
+ ((|bpEqKey| |ps| 'IMPORT)
(COND
- ((|bpEqKey| 'NAMESPACE)
+ ((|bpEqKey| |ps| 'NAMESPACE)
(OR
(AND (|bpLeftAssoc| |ps| '(DOT) #'|bpName|)
- (|bpPush| |ps| (|%Import| (|bfNamespace| (|bpPop1|)))))
+ (|bpPush| |ps| (|%Import| (|bfNamespace| (|bpPop1| |ps|)))))
(|bpTrap|)))
- (T (SETQ |a| (|bpState|)) (|bpRequire| |ps| #'|bpName|)
+ (T (SETQ |a| (|bpState| |ps|)) (|bpRequire| |ps| #'|bpName|)
(COND
- ((|bpEqPeek| 'COLON) (|bpRestore| |a|)
+ ((|bpEqPeek| 'COLON) (|bpRestore| |ps| |a|)
(AND (|bpRequire| |ps| #'|bpSignature|)
- (OR (|bpEqKey| 'FOR) (|bpTrap|)) (|bpRequire| |ps| #'|bpName|)
- (|bpPush| |ps| (|%ImportSignature| (|bpPop1|) (|bpPop1|)))))
- (T (|bpPush| |ps| (|%Import| (|bpPop1|))))))))
+ (OR (|bpEqKey| |ps| 'FOR) (|bpTrap|))
+ (|bpRequire| |ps| #'|bpName|)
+ (|bpPush| |ps|
+ (|%ImportSignature| (|bpPop1| |ps|)
+ (|bpPop1| |ps|)))))
+ (T (|bpPush| |ps| (|%Import| (|bpPop1| |ps|))))))))
(T NIL))))
(DEFUN |bpNamespace| (|ps|)
- (AND (|bpEqKey| 'NAMESPACE) (OR (|bpName| |ps|) (|bpDot| |ps|))
- (|bpPush| |ps| (|bfNamespace| (|bpPop1|)))))
+ (AND (|bpEqKey| |ps| 'NAMESPACE) (OR (|bpName| |ps|) (|bpDot| |ps|))
+ (|bpPush| |ps| (|bfNamespace| (|bpPop1| |ps|)))))
(DEFUN |bpTypeAliasDefition| (|ps|)
- (AND (OR (|bpTerm| |ps| #'|bpIdList|) (|bpTrap|)) (|bpEqKey| 'TDEF)
- (|bpLogical| |ps|) (|bpPush| |ps| (|%TypeAlias| (|bpPop2|) (|bpPop1|)))))
+ (AND (OR (|bpTerm| |ps| #'|bpIdList|) (|bpTrap|)) (|bpEqKey| |ps| 'TDEF)
+ (|bpLogical| |ps|)
+ (|bpPush| |ps| (|%TypeAlias| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(DEFUN |bpSignature| (|ps|)
- (AND (|bpName| |ps|) (|bpEqKey| 'COLON) (|bpRequire| |ps| #'|bpTyping|)
- (|bpPush| |ps| (|%Signature| (|bpPop2|) (|bpPop1|)))))
+ (AND (|bpName| |ps|) (|bpEqKey| |ps| 'COLON) (|bpRequire| |ps| #'|bpTyping|)
+ (|bpPush| |ps| (|%Signature| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(DEFUN |bpSimpleMapping| (|ps|)
(COND
((|bpApplication| |ps|)
- (AND (|bpEqKey| 'ARROW) (|bpRequire| |ps| #'|bpApplication|)
- (|bpPush| |ps| (|%Mapping| (|bpPop1|) (LIST (|bpPop1|)))))
+ (AND (|bpEqKey| |ps| 'ARROW) (|bpRequire| |ps| #'|bpApplication|)
+ (|bpPush| |ps| (|%Mapping| (|bpPop1| |ps|) (LIST (|bpPop1| |ps|)))))
T)
(T NIL)))
(DEFUN |bpArgtypeList| (|ps|) (|bpTuple| |ps| #'|bpSimpleMapping|))
(DEFUN |bpMapping| (|ps|)
- (AND (|bpParenthesized| |ps| #'|bpArgtypeList|) (|bpEqKey| 'ARROW)
+ (AND (|bpParenthesized| |ps| #'|bpArgtypeList|) (|bpEqKey| |ps| 'ARROW)
(|bpApplication| |ps|)
- (|bpPush| |ps| (|%Mapping| (|bpPop1|) (|bfUntuple| (|bpPop1|))))))
+ (|bpPush| |ps|
+ (|%Mapping| (|bpPop1| |ps|) (|bfUntuple| (|bpPop1| |ps|))))))
-(DEFUN |bpCancel| ()
+(DEFUN |bpCancel| (|ps|)
(LET* (|a|)
(PROGN
- (SETQ |a| (|bpState|))
+ (SETQ |a| (|bpState| |ps|))
(COND
- ((|bpEqKeyNextTok| 'SETTAB)
+ ((|bpEqKeyNextTok| |ps| 'SETTAB)
(COND
- ((|bpCancel|)
- (COND ((|bpEqKeyNextTok| 'BACKTAB) T) (T (|bpRestore| |a|) NIL)))
- ((|bpEqKeyNextTok| 'BACKTAB) T) (T (|bpRestore| |a|) NIL)))
+ ((|bpCancel| |ps|)
+ (COND ((|bpEqKeyNextTok| |ps| 'BACKTAB) T)
+ (T (|bpRestore| |ps| |a|) NIL)))
+ ((|bpEqKeyNextTok| |ps| 'BACKTAB) T) (T (|bpRestore| |ps| |a|) NIL)))
(T NIL)))))
(DEFUN |bpAddTokens| (|n|)
@@ -572,32 +592,35 @@
(COND
((AND (EQ (|tokenClass| |$stok|) 'KEY) (NOT (|bpExceptions|)))
(SETQ |a| (GET |$ttok| 'SHOEINF))
- (COND ((NULL |a|) (AND (|bpPush| |ps| (|keywordId| |$ttok|)) (|bpNext|)))
- (T (AND (|bpPush| |ps| |a|) (|bpNext|)))))
+ (COND
+ ((NULL |a|) (AND (|bpPush| |ps| (|keywordId| |$ttok|)) (|bpNext| |ps|)))
+ (T (AND (|bpPush| |ps| |a|) (|bpNext| |ps|)))))
(T NIL))))
(DEFUN |bpAnyId| (|ps|)
(DECLARE (SPECIAL |$ttok| |$stok|))
(OR
- (AND (|bpEqKey| 'MINUS) (OR (EQ (|tokenClass| |$stok|) 'INTEGER) (|bpTrap|))
- (|bpPush| |ps| (- |$ttok|)) (|bpNext|))
+ (AND (|bpEqKey| |ps| 'MINUS)
+ (OR (EQ (|tokenClass| |$stok|) 'INTEGER) (|bpTrap|))
+ (|bpPush| |ps| (- |$ttok|)) (|bpNext| |ps|))
(|bpSexpKey| |ps|)
(AND (|symbolMember?| (|tokenClass| |$stok|) '(ID INTEGER STRING FLOAT))
- (|bpPush| |ps| |$ttok|) (|bpNext|))))
+ (|bpPush| |ps| |$ttok|) (|bpNext| |ps|))))
(DEFUN |bpSexp| (|ps|)
(OR (|bpAnyId| |ps|)
- (AND (|bpEqKey| 'QUOTE) (|bpRequire| |ps| #'|bpSexp|)
- (|bpPush| |ps| (|bfSymbol| (|bpPop1|))))
+ (AND (|bpEqKey| |ps| 'QUOTE) (|bpRequire| |ps| #'|bpSexp|)
+ (|bpPush| |ps| (|bfSymbol| (|bpPop1| |ps|))))
(|bpIndentParenthesized| |ps| #'|bpSexp1|)))
(DEFUN |bpSexp1| (|ps|)
(OR
- (AND (|bpFirstTok|) (|bpSexp| |ps|)
+ (AND (|bpFirstTok| |ps|) (|bpSexp| |ps|)
(OR
- (AND (|bpEqKey| 'DOT) (|bpSexp| |ps|)
- (|bpPush| |ps| (CONS (|bpPop2|) (|bpPop1|))))
- (AND (|bpSexp1| |ps|) (|bpPush| |ps| (CONS (|bpPop2|) (|bpPop1|))))))
+ (AND (|bpEqKey| |ps| 'DOT) (|bpSexp| |ps|)
+ (|bpPush| |ps| (CONS (|bpPop2| |ps|) (|bpPop1| |ps|))))
+ (AND (|bpSexp1| |ps|)
+ (|bpPush| |ps| (CONS (|bpPop2| |ps|) (|bpPop1| |ps|))))))
(|bpPush| |ps| NIL)))
(DEFUN |bpPrimary1| (|ps|)
@@ -610,56 +633,57 @@
(DEFUN |bpArgumentList| (|ps|)
(AND (|bpPDefinition| |ps|)
- (|bpPush| |ps| (|bfApplication| (|bpPop2|) (|bpPop1|)))))
+ (|bpPush| |ps| (|bfApplication| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(DEFUN |bpPrimary| (|ps|)
- (AND (|bpFirstTok|) (OR (|bpPrimary1| |ps|) (|bpPrefixOperator| |ps|))))
+ (AND (|bpFirstTok| |ps|) (OR (|bpPrimary1| |ps|) (|bpPrefixOperator| |ps|))))
-(DEFUN |bpDot| (|ps|) (AND (|bpEqKey| 'DOT) (|bpPush| |ps| (|bfDot|))))
+(DEFUN |bpDot| (|ps|) (AND (|bpEqKey| |ps| 'DOT) (|bpPush| |ps| (|bfDot|))))
(DEFUN |bpPrefixOperator| (|ps|)
(DECLARE (SPECIAL |$ttok| |$stok|))
(AND (EQ (|tokenClass| |$stok|) 'KEY) (GET |$ttok| 'SHOEPRE)
- (|bpPushId| |ps|) (|bpNext|)))
+ (|bpPushId| |ps|) (|bpNext| |ps|)))
(DEFUN |bpInfixOperator| (|ps|)
(DECLARE (SPECIAL |$ttok| |$stok|))
(AND (EQ (|tokenClass| |$stok|) 'KEY) (GET |$ttok| 'SHOEINF)
- (|bpPushId| |ps|) (|bpNext|)))
+ (|bpPushId| |ps|) (|bpNext| |ps|)))
(DEFUN |bpSelector| (|ps|)
- (AND (|bpEqKey| 'DOT)
+ (AND (|bpEqKey| |ps| 'DOT)
(OR
(AND (|bpPrimary| |ps|)
- (|bpPush| |ps| (|bfElt| (|bpPop2|) (|bpPop1|))))
- (|bpPush| |ps| (|bfSuffixDot| (|bpPop1|))))))
+ (|bpPush| |ps| (|bfElt| (|bpPop2| |ps|) (|bpPop1| |ps|))))
+ (|bpPush| |ps| (|bfSuffixDot| (|bpPop1| |ps|))))))
(DEFUN |bpApplication| (|ps|)
(OR
(AND (|bpPrimary| |ps|) (|bpAnyNo| |ps| #'|bpSelector|)
(OR
(AND (|bpApplication| |ps|)
- (|bpPush| |ps| (|bfApplication| (|bpPop2|) (|bpPop1|))))
+ (|bpPush| |ps|
+ (|bfApplication| (|bpPop2| |ps|) (|bpPop1| |ps|))))
T))
(|bpNamespace| |ps|)))
(DEFUN |bpTyping| (|ps|)
(COND
- ((|bpEqKey| 'FORALL) (|bpRequire| |ps| #'|bpVariable|)
- (OR (AND (|bpDot| |ps|) (|bpPop1|)) (|bpTrap|))
+ ((|bpEqKey| |ps| 'FORALL) (|bpRequire| |ps| #'|bpVariable|)
+ (OR (AND (|bpDot| |ps|) (|bpPop1| |ps|)) (|bpTrap|))
(|bpRequire| |ps| #'|bpTyping|)
- (|bpPush| |ps| (|%Forall| (|bpPop2|) (|bpPop1|))))
+ (|bpPush| |ps| (|%Forall| (|bpPop2| |ps|) (|bpPop1| |ps|))))
(T (OR (|bpMapping| |ps|) (|bpSimpleMapping| |ps|)))))
(DEFUN |bpTyped| (|ps|)
(AND (|bpApplication| |ps|)
(COND
- ((|bpEqKey| 'COLON)
+ ((|bpEqKey| |ps| 'COLON)
(AND (|bpRequire| |ps| #'|bpTyping|)
- (|bpPush| |ps| (|bfTagged| (|bpPop2|) (|bpPop1|)))))
- ((|bpEqKey| 'AT)
+ (|bpPush| |ps| (|bfTagged| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
+ ((|bpEqKey| |ps| 'AT)
(AND (|bpRequire| |ps| #'|bpTyping|)
- (|bpPush| |ps| (|bfRestrict| (|bpPop2|) (|bpPop1|)))))
+ (|bpPush| |ps| (|bfRestrict| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(T T))))
(DEFUN |bpExpt| (|ps|) (|bpRightAssoc| |ps| '(POWER) #'|bpTyped|))
@@ -667,15 +691,15 @@
(DEFUN |bpInfKey| (|ps| |s|)
(DECLARE (SPECIAL |$ttok| |$stok|))
(AND (EQ (|tokenClass| |$stok|) 'KEY) (|symbolMember?| |$ttok| |s|)
- (|bpPushId| |ps|) (|bpNext|)))
+ (|bpPushId| |ps|) (|bpNext| |ps|)))
(DEFUN |bpInfGeneric| (|ps| |s|)
- (AND (|bpInfKey| |ps| |s|) (OR (|bpEqKey| 'BACKSET) T)))
+ (AND (|bpInfKey| |ps| |s|) (OR (|bpEqKey| |ps| 'BACKSET) T)))
(DEFUN |bpRightAssoc| (|ps| |o| |p|)
(LET* (|a|)
(PROGN
- (SETQ |a| (|bpState|))
+ (SETQ |a| (|bpState| |ps|))
(COND
((APPLY |p| |ps| NIL)
(LOOP
@@ -686,9 +710,10 @@
(RETURN NIL))
(T
(|bpPush| |ps|
- (|bfInfApplication| (|bpPop2|) (|bpPop2|) (|bpPop1|))))))
+ (|bfInfApplication| (|bpPop2| |ps|) (|bpPop2| |ps|)
+ (|bpPop1| |ps|))))))
T)
- (T (|bpRestore| |a|) NIL)))))
+ (T (|bpRestore| |ps| |a|) NIL)))))
(DEFUN |bpLeftAssoc| (|ps| |operations| |parser|)
(COND
@@ -699,24 +724,26 @@
(AND (|bpInfGeneric| |ps| |operations|) (|bpRequire| |ps| |parser|)))
(RETURN NIL))
(T
- (|bpPush| |ps| (|bfInfApplication| (|bpPop2|) (|bpPop2|) (|bpPop1|))))))
+ (|bpPush| |ps|
+ (|bfInfApplication| (|bpPop2| |ps|) (|bpPop2| |ps|)
+ (|bpPop1| |ps|))))))
T)
(T NIL)))
(DEFUN |bpString| (|ps|)
(DECLARE (SPECIAL |$ttok| |$stok|))
(AND (EQ (|tokenClass| |$stok|) 'STRING)
- (|bpPush| |ps| (|quote| (INTERN |$ttok|))) (|bpNext|)))
+ (|bpPush| |ps| (|quote| (INTERN |$ttok|))) (|bpNext| |ps|)))
(DEFUN |bpFunction| (|ps|)
- (AND (|bpEqKey| 'FUNCTION) (|bpRequire| |ps| #'|bpPrimary1|)
- (|bpPush| |ps| (|bfFunction| (|bpPop1|)))))
+ (AND (|bpEqKey| |ps| 'FUNCTION) (|bpRequire| |ps| #'|bpPrimary1|)
+ (|bpPush| |ps| (|bfFunction| (|bpPop1| |ps|)))))
(DEFUN |bpThetaName| (|ps|)
(DECLARE (SPECIAL |$ttok| |$stok|))
(COND
((AND (EQ (|tokenClass| |$stok|) 'ID) (GET |$ttok| 'SHOETHETA))
- (|bpPushId| |ps|) (|bpNext|))
+ (|bpPushId| |ps|) (|bpNext| |ps|))
(T NIL)))
(DEFUN |bpReduceOperator| (|ps|)
@@ -725,17 +752,18 @@
(DEFUN |bpReduce| (|ps|)
(LET* (|a|)
(PROGN
- (SETQ |a| (|bpState|))
+ (SETQ |a| (|bpState| |ps|))
(COND
- ((AND (|bpReduceOperator| |ps|) (|bpEqKey| 'SLASH))
+ ((AND (|bpReduceOperator| |ps|) (|bpEqKey| |ps| 'SLASH))
(COND
((|bpEqPeek| 'OBRACK)
(AND (|bpRequire| |ps| #'|bpDConstruct|)
- (|bpPush| |ps| (|bfReduceCollect| (|bpPop2|) (|bpPop1|)))))
+ (|bpPush| |ps|
+ (|bfReduceCollect| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(T
(AND (|bpRequire| |ps| #'|bpApplication|)
- (|bpPush| |ps| (|bfReduce| (|bpPop2|) (|bpPop1|)))))))
- (T (|bpRestore| |a|) NIL)))))
+ (|bpPush| |ps| (|bfReduce| (|bpPop2| |ps|) (|bpPop1| |ps|)))))))
+ (T (|bpRestore| |ps| |a|) NIL)))))
(DEFUN |bpTimes| (|ps|)
(OR (|bpReduce| |ps|) (|bpLeftAssoc| |ps| '(TIMES SLASH) #'|bpExpt|)))
@@ -745,7 +773,7 @@
(DEFUN |bpMinus| (|ps|)
(OR
(AND (|bpInfGeneric| |ps| '(MINUS)) (|bpRequire| |ps| #'|bpEuclid|)
- (|bpPush| |ps| (|bfApplication| (|bpPop2|) (|bpPop1|))))
+ (|bpPush| |ps| (|bfApplication| (|bpPop2| |ps|) (|bpPop1| |ps|))))
(|bpEuclid| |ps|)))
(DEFUN |bpArith| (|ps|) (|bpLeftAssoc| |ps| '(PLUS MINUS) #'|bpMinus|))
@@ -754,13 +782,15 @@
(AND (|bpArith| |ps|)
(COND
((AND (|bpInfKey| |ps| '(IS ISNT)) (|bpRequire| |ps| #'|bpPattern|))
- (|bpPush| |ps| (|bfISApplication| (|bpPop2|) (|bpPop2|) (|bpPop1|))))
- ((AND (|bpEqKey| 'HAS) (|bpRequire| |ps| #'|bpApplication|))
- (|bpPush| |ps| (|bfHas| (|bpPop2|) (|bpPop1|))))
+ (|bpPush| |ps|
+ (|bfISApplication| (|bpPop2| |ps|) (|bpPop2| |ps|)
+ (|bpPop1| |ps|))))
+ ((AND (|bpEqKey| |ps| 'HAS) (|bpRequire| |ps| #'|bpApplication|))
+ (|bpPush| |ps| (|bfHas| (|bpPop2| |ps|) (|bpPop1| |ps|))))
(T T))))
(DEFUN |bpBracketConstruct| (|ps| |f|)
- (AND (|bpBracket| |ps| |f|) (|bpPush| |ps| (|bfConstruct| (|bpPop1|)))))
+ (AND (|bpBracket| |ps| |f|) (|bpPush| |ps| (|bfConstruct| (|bpPop1| |ps|)))))
(DEFUN |bpCompare| (|ps|)
(OR
@@ -769,7 +799,8 @@
(AND (|bpInfKey| |ps| '(SHOEEQ SHOENE LT LE GT GE IN))
(|bpRequire| |ps| #'|bpIs|)
(|bpPush| |ps|
- (|bfInfApplication| (|bpPop2|) (|bpPop2|) (|bpPop1|))))
+ (|bfInfApplication| (|bpPop2| |ps|) (|bpPop2| |ps|)
+ (|bpPop1| |ps|))))
T))
(|bpLeave| |ps|) (|bpThrow| |ps|)))
@@ -777,34 +808,34 @@
(DEFUN |bpThrow| (|ps|)
(COND
- ((AND (|bpEqKey| 'THROW) (|bpApplication| |ps|))
+ ((AND (|bpEqKey| |ps| 'THROW) (|bpApplication| |ps|))
(COND
- ((|bpEqKey| 'COLON) (|bpRequire| |ps| #'|bpApplication|)
- (|bpPush| |ps| (|%Pretend| (|bpPop2|) (|bpPop1|)))))
- (|bpPush| |ps| (|bfThrow| (|bpPop1|))))
+ ((|bpEqKey| |ps| 'COLON) (|bpRequire| |ps| #'|bpApplication|)
+ (|bpPush| |ps| (|%Pretend| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
+ (|bpPush| |ps| (|bfThrow| (|bpPop1| |ps|))))
(T NIL)))
(DEFUN |bpTry| (|ps|)
(LET* (|cs|)
(COND
- ((|bpEqKey| 'TRY) (|bpAssign| |ps|) (SETQ |cs| NIL)
+ ((|bpEqKey| |ps| 'TRY) (|bpAssign| |ps|) (SETQ |cs| NIL)
(LOOP
- (COND ((NOT (|bpHandler| 'CATCH)) (RETURN NIL))
- (T (|bpCatchItem| |ps|) (SETQ |cs| (CONS (|bpPop1|) |cs|)))))
+ (COND ((NOT (|bpHandler| |ps| 'CATCH)) (RETURN NIL))
+ (T (|bpCatchItem| |ps|) (SETQ |cs| (CONS (|bpPop1| |ps|) |cs|)))))
(COND
- ((|bpHandler| 'FINALLY)
+ ((|bpHandler| |ps| 'FINALLY)
(AND (|bpFinally| |ps|)
(|bpPush| |ps|
- (|bfTry| (|bpPop2|)
- (|reverse!| (CONS (|bpPop1|) |cs|))))))
+ (|bfTry| (|bpPop2| |ps|)
+ (|reverse!| (CONS (|bpPop1| |ps|) |cs|))))))
((NULL |cs|) (|bpTrap|))
- (T (|bpPush| |ps| (|bfTry| (|bpPop1|) (|reverse!| |cs|))))))
+ (T (|bpPush| |ps| (|bfTry| (|bpPop1| |ps|) (|reverse!| |cs|))))))
(T NIL))))
(DEFUN |bpCatchItem| (|ps|)
(AND (|bpRequire| |ps| #'|bpExceptionVariable|)
- (OR (|bpEqKey| 'EXIT) (|bpTrap|)) (|bpRequire| |ps| #'|bpAssign|)
- (|bpPush| |ps| (|%Catch| (|bpPop2|) (|bpPop1|)))))
+ (OR (|bpEqKey| |ps| 'EXIT) (|bpTrap|)) (|bpRequire| |ps| #'|bpAssign|)
+ (|bpPush| |ps| (|%Catch| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(DEFUN |bpExceptionVariable| (|ps|)
(LET* (|t|)
@@ -812,49 +843,51 @@
(PROGN
(SETQ |t| |$stok|)
(OR
- (AND (|bpEqKey| 'OPAREN) (|bpRequire| |ps| #'|bpSignature|)
- (OR (|bpEqKey| 'CPAREN) (|bpMissing| |t|)))
+ (AND (|bpEqKey| |ps| 'OPAREN) (|bpRequire| |ps| #'|bpSignature|)
+ (OR (|bpEqKey| |ps| 'CPAREN) (|bpMissing| |t|)))
(|bpTrap|)))))
(DEFUN |bpFinally| (|ps|)
- (AND (|bpRequire| |ps| #'|bpAssign|) (|bpPush| |ps| (|%Finally| (|bpPop1|)))))
+ (AND (|bpRequire| |ps| #'|bpAssign|)
+ (|bpPush| |ps| (|%Finally| (|bpPop1| |ps|)))))
-(DEFUN |bpHandler| (|key|)
+(DEFUN |bpHandler| (|ps| |key|)
(LET* (|s|)
(PROGN
- (SETQ |s| (|bpState|))
+ (SETQ |s| (|bpState| |ps|))
(COND
- ((AND (OR (|bpEqKey| 'BACKSET) (|bpEqKey| 'SEMICOLON)) (|bpEqKey| |key|))
+ ((AND (OR (|bpEqKey| |ps| 'BACKSET) (|bpEqKey| |ps| 'SEMICOLON))
+ (|bpEqKey| |ps| |key|))
T)
- (T (|bpRestore| |s|) NIL)))))
+ (T (|bpRestore| |ps| |s|) NIL)))))
(DEFUN |bpLeave| (|ps|)
- (AND (|bpEqKey| 'LEAVE) (|bpRequire| |ps| #'|bpLogical|)
- (|bpPush| |ps| (|bfLeave| (|bpPop1|)))))
+ (AND (|bpEqKey| |ps| 'LEAVE) (|bpRequire| |ps| #'|bpLogical|)
+ (|bpPush| |ps| (|bfLeave| (|bpPop1| |ps|)))))
(DEFUN |bpDo| (|ps|)
(COND
- ((|bpEqKey| 'IN) (|bpRequire| |ps| #'|bpNamespace|)
+ ((|bpEqKey| |ps| 'IN) (|bpRequire| |ps| #'|bpNamespace|)
(|bpRequire| |ps| #'|bpDo|)
- (|bpPush| |ps| (|bfAtScope| (|bpPop2|) (|bpPop1|))))
+ (|bpPush| |ps| (|bfAtScope| (|bpPop2| |ps|) (|bpPop1| |ps|))))
(T
- (AND (|bpEqKey| 'DO) (|bpRequire| |ps| #'|bpAssign|)
- (|bpPush| |ps| (|bfDo| (|bpPop1|)))))))
+ (AND (|bpEqKey| |ps| 'DO) (|bpRequire| |ps| #'|bpAssign|)
+ (|bpPush| |ps| (|bfDo| (|bpPop1| |ps|)))))))
(DEFUN |bpReturn| (|ps|)
(OR
- (AND (|bpEqKey| 'RETURN) (|bpRequire| |ps| #'|bpAssign|)
- (|bpPush| |ps| (|bfReturnNoName| (|bpPop1|))))
+ (AND (|bpEqKey| |ps| 'RETURN) (|bpRequire| |ps| #'|bpAssign|)
+ (|bpPush| |ps| (|bfReturnNoName| (|bpPop1| |ps|))))
(|bpLeave| |ps|) (|bpThrow| |ps|) (|bpAnd| |ps|) (|bpDo| |ps|)))
(DEFUN |bpLogical| (|ps|) (|bpLeftAssoc| |ps| '(OR) #'|bpReturn|))
(DEFUN |bpExpression| (|ps|)
(OR
- (AND (|bpEqKey| 'COLON)
+ (AND (|bpEqKey| |ps| 'COLON)
(OR
(AND (|bpLogical| |ps|)
- (|bpPush| |ps| (|bfApplication| 'COLON (|bpPop1|))))
+ (|bpPush| |ps| (|bfApplication| 'COLON (|bpPop1| |ps|))))
(|bpTrap|)))
(|bpLogical| |ps|)))
@@ -864,11 +897,11 @@
(DEFUN |bpLoop| (|ps|)
(OR
- (AND (|bpIterators| |ps|) (|bpCompMissing| 'REPEAT)
+ (AND (|bpIterators| |ps|) (|bpCompMissing| |ps| 'REPEAT)
(|bpRequire| |ps| #'|bpWhere|)
- (|bpPush| |ps| (|bfLp| (|bpPop2|) (|bpPop1|))))
- (AND (|bpEqKey| 'REPEAT) (|bpRequire| |ps| #'|bpLogical|)
- (|bpPush| |ps| (|bfLoop1| (|bpPop1|))))))
+ (|bpPush| |ps| (|bfLp| (|bpPop2| |ps|) (|bpPop1| |ps|))))
+ (AND (|bpEqKey| |ps| 'REPEAT) (|bpRequire| |ps| #'|bpLogical|)
+ (|bpPush| |ps| (|bfLoop1| (|bpPop1| |ps|))))))
(DEFUN |bpSuchThat| (|ps|) (|bpAndOr| |ps| 'BAR #'|bpWhere| #'|bfSuchthat|))
@@ -879,21 +912,25 @@
(DEFUN |bpFormal| (|ps|) (OR (|bpVariable| |ps|) (|bpDot| |ps|)))
(DEFUN |bpForIn| (|ps|)
- (AND (|bpEqKey| 'FOR) (|bpRequire| |ps| #'|bpFormal|) (|bpCompMissing| 'IN)
+ (AND (|bpEqKey| |ps| 'FOR) (|bpRequire| |ps| #'|bpFormal|)
+ (|bpCompMissing| |ps| 'IN)
(OR
- (AND (|bpRequire| |ps| #'|bpSeg|) (|bpEqKey| 'BY)
+ (AND (|bpRequire| |ps| #'|bpSeg|) (|bpEqKey| |ps| 'BY)
(|bpRequire| |ps| #'|bpArith|)
- (|bpPush| |ps| (|bfForInBy| (|bpPop3|) (|bpPop2|) (|bpPop1|))))
- (|bpPush| |ps| (|bfForin| (|bpPop2|) (|bpPop1|))))))
+ (|bpPush| |ps|
+ (|bfForInBy| (|bpPop3| |ps|) (|bpPop2| |ps|)
+ (|bpPop1| |ps|))))
+ (|bpPush| |ps| (|bfForin| (|bpPop2| |ps|) (|bpPop1| |ps|))))))
(DEFUN |bpSeg| (|ps|)
(AND (|bpArith| |ps|)
(OR
- (AND (|bpEqKey| 'SEG)
+ (AND (|bpEqKey| |ps| 'SEG)
(OR
(AND (|bpArith| |ps|)
- (|bpPush| |ps| (|bfSegment2| (|bpPop2|) (|bpPop1|))))
- (|bpPush| |ps| (|bfSegment1| (|bpPop1|)))))
+ (|bpPush| |ps|
+ (|bfSegment2| (|bpPop2| |ps|) (|bpPop1| |ps|))))
+ (|bpPush| |ps| (|bfSegment1| (|bpPop1| |ps|)))))
T)))
(DEFUN |bpIterator| (|ps|)
@@ -901,10 +938,10 @@
(DEFUN |bpIteratorList| (|ps|)
(AND (|bpOneOrMore| |ps| #'|bpIterator|)
- (|bpPush| |ps| (|bfIterators| (|bpPop1|)))))
+ (|bpPush| |ps| (|bfIterators| (|bpPop1| |ps|)))))
(DEFUN |bpCrossBackSet| (|ps|)
- (AND (|bpEqKey| 'CROSS) (OR (|bpEqKey| 'BACKSET) T)))
+ (AND (|bpEqKey| |ps| 'CROSS) (OR (|bpEqKey| |ps| 'BACKSET) T)))
(DEFUN |bpIterators| (|ps|)
(|bpListofFun| |ps| #'|bpIteratorList| #'|bpCrossBackSet| #'|bfCross|))
@@ -912,54 +949,56 @@
(DEFUN |bpAssign| (|ps|)
(LET* (|a|)
(PROGN
- (SETQ |a| (|bpState|))
+ (SETQ |a| (|bpState| |ps|))
(COND
((|bpStatement| |ps|)
(COND
- ((|bpEqPeek| 'BEC) (|bpRestore| |a|)
+ ((|bpEqPeek| 'BEC) (|bpRestore| |ps| |a|)
(|bpRequire| |ps| #'|bpAssignment|))
- ((|bpEqPeek| 'GIVES) (|bpRestore| |a|) (|bpRequire| |ps| #'|bpLambda|))
- ((|bpEqPeek| 'LARROW) (|bpRestore| |a|)
+ ((|bpEqPeek| 'GIVES) (|bpRestore| |ps| |a|)
+ (|bpRequire| |ps| #'|bpLambda|))
+ ((|bpEqPeek| 'LARROW) (|bpRestore| |ps| |a|)
(|bpRequire| |ps| #'|bpKeyArg|))
(T T)))
- (T (|bpRestore| |a|) NIL)))))
+ (T (|bpRestore| |ps| |a|) NIL)))))
(DEFUN |bpAssignment| (|ps|)
- (AND (|bpAssignVariable| |ps|) (|bpEqKey| 'BEC)
+ (AND (|bpAssignVariable| |ps|) (|bpEqKey| |ps| 'BEC)
(|bpRequire| |ps| #'|bpAssign|)
- (|bpPush| |ps| (|bfAssign| (|bpPop2|) (|bpPop1|)))))
+ (|bpPush| |ps| (|bfAssign| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(DEFUN |bpLambda| (|ps|)
- (AND (|bpVariable| |ps|) (|bpEqKey| 'GIVES) (|bpRequire| |ps| #'|bpAssign|)
- (|bpPush| |ps| (|bfLambda| (|bpPop2|) (|bpPop1|)))))
+ (AND (|bpVariable| |ps|) (|bpEqKey| |ps| 'GIVES)
+ (|bpRequire| |ps| #'|bpAssign|)
+ (|bpPush| |ps| (|bfLambda| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(DEFUN |bpKeyArg| (|ps|)
- (AND (|bpName| |ps|) (|bpEqKey| 'LARROW) (|bpLogical| |ps|)
- (|bpPush| |ps| (|bfKeyArg| (|bpPop2|) (|bpPop1|)))))
+ (AND (|bpName| |ps|) (|bpEqKey| |ps| 'LARROW) (|bpLogical| |ps|)
+ (|bpPush| |ps| (|bfKeyArg| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(DEFUN |bpExit| (|ps|)
(AND (|bpAssign| |ps|)
(OR
- (AND (|bpEqKey| 'EXIT) (|bpRequire| |ps| #'|bpWhere|)
- (|bpPush| |ps| (|bfExit| (|bpPop2|) (|bpPop1|))))
+ (AND (|bpEqKey| |ps| 'EXIT) (|bpRequire| |ps| #'|bpWhere|)
+ (|bpPush| |ps| (|bfExit| (|bpPop2| |ps|) (|bpPop1| |ps|))))
T)))
(DEFUN |bpDefinition| (|ps|)
(LET* (|a|)
(COND
- ((|bpEqKey| 'MACRO)
+ ((|bpEqKey| |ps| 'MACRO)
(OR
(AND (|bpName| |ps|) (|bpStoreName|)
(|bpCompoundDefinitionTail| |ps| #'|%Macro|))
(|bpTrap|)))
- (T (SETQ |a| (|bpState|))
+ (T (SETQ |a| (|bpState| |ps|))
(COND
((|bpExit| |ps|)
- (COND ((|bpEqPeek| 'DEF) (|bpRestore| |a|) (|bpDef| |ps|))
- ((|bpEqPeek| 'TDEF) (|bpRestore| |a|)
+ (COND ((|bpEqPeek| 'DEF) (|bpRestore| |ps| |a|) (|bpDef| |ps|))
+ ((|bpEqPeek| 'TDEF) (|bpRestore| |ps| |a|)
(|bpTypeAliasDefition| |ps|))
(T T)))
- (T (|bpRestore| |a|) NIL))))))
+ (T (|bpRestore| |ps| |a|) NIL))))))
(DEFUN |bpStoreName| ()
(DECLARE (SPECIAL |$typings| |$wheredefs| |$op| |$stack|))
@@ -976,12 +1015,15 @@
(DEFUN |bpDDef| (|ps|) (AND (|bpName| |ps|) (|bpDefTail| |ps| #'|%Definition|)))
(DEFUN |bpSimpleDefinitionTail| (|ps|)
- (AND (|bpEqKey| 'DEF) (|bpRequire| |ps| #'|bpWhere|)
- (|bpPush| |ps| (|%ConstantDefinition| (|bpPop2|) (|bpPop1|)))))
+ (AND (|bpEqKey| |ps| 'DEF) (|bpRequire| |ps| #'|bpWhere|)
+ (|bpPush| |ps| (|%ConstantDefinition| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(DEFUN |bpCompoundDefinitionTail| (|ps| |f|)
- (AND (|bpVariable| |ps|) (|bpEqKey| 'DEF) (|bpRequire| |ps| #'|bpWhere|)
- (|bpPush| |ps| (APPLY |f| (LIST (|bpPop3|) (|bpPop2|) (|bpPop1|))))))
+ (AND (|bpVariable| |ps|) (|bpEqKey| |ps| 'DEF) (|bpRequire| |ps| #'|bpWhere|)
+ (|bpPush| |ps|
+ (APPLY |f|
+ (LIST (|bpPop3| |ps|) (|bpPop2| |ps|)
+ (|bpPop1| |ps|))))))
(DEFUN |bpDefTail| (|ps| |f|)
(OR (|bpSimpleDefinitionTail| |ps|) (|bpCompoundDefinitionTail| |ps| |f|)))
@@ -989,24 +1031,24 @@
(DEFUN |bpWhere| (|ps|)
(AND (|bpDefinition| |ps|)
(OR
- (AND (|bpEqKey| 'WHERE) (|bpRequire| |ps| #'|bpDefinitionItem|)
- (|bpPush| |ps| (|bfWhere| (|bpPop1|) (|bpPop1|))))
+ (AND (|bpEqKey| |ps| 'WHERE) (|bpRequire| |ps| #'|bpDefinitionItem|)
+ (|bpPush| |ps| (|bfWhere| (|bpPop1| |ps|) (|bpPop1| |ps|))))
T)))
(DEFUN |bpDefinitionItem| (|ps|)
(LET* (|a|)
(PROGN
- (SETQ |a| (|bpState|))
+ (SETQ |a| (|bpState| |ps|))
(COND ((|bpDDef| |ps|) T)
- (T (|bpRestore| |a|)
+ (T (|bpRestore| |ps| |a|)
(COND ((|bpBDefinitionPileItems| |ps|) T)
- (T (|bpRestore| |a|)
+ (T (|bpRestore| |ps| |a|)
(COND ((|bpPDefinitionItems| |ps|) T)
- (T (|bpRestore| |a|) (|bpWhere| |ps|))))))))))
+ (T (|bpRestore| |ps| |a|) (|bpWhere| |ps|))))))))))
(DEFUN |bpDefinitionPileItems| (|ps|)
(AND (|bpListAndRecover| |ps| #'|bpDefinitionItem|)
- (|bpPush| |ps| (|%Pile| (|bpPop1|)))))
+ (|bpPush| |ps| (|%Pile| (|bpPop1| |ps|)))))
(DEFUN |bpBDefinitionPileItems| (|ps|)
(|bpPileBracketed| |ps| #'|bpDefinitionPileItems|))
@@ -1024,7 +1066,7 @@
(|bpListofFun| |ps| |p| #'|bpCommaBackSet| #'|bfTuple|))
(DEFUN |bpCommaBackSet| (|ps|)
- (AND (|bpEqKey| 'COMMA) (OR (|bpEqKey| 'BACKSET) T)))
+ (AND (|bpEqKey| |ps| 'COMMA) (OR (|bpEqKey| |ps| 'BACKSET) T)))
(DEFUN |bpSemiColon| (|ps|) (|bpSemiListing| |ps| #'|bpComma| #'|bfSequence|))
@@ -1032,18 +1074,18 @@
(|bpListofFun| |ps| |p| #'|bpSemiBackSet| |f|))
(DEFUN |bpSemiBackSet| (|ps|)
- (AND (|bpEqKey| 'SEMICOLON) (OR (|bpEqKey| 'BACKSET) T)))
+ (AND (|bpEqKey| |ps| 'SEMICOLON) (OR (|bpEqKey| |ps| 'BACKSET) T)))
(DEFUN |bpPDefinition| (|ps|) (|bpIndentParenthesized| |ps| #'|bpSemiColon|))
(DEFUN |bpPileItems| (|ps|)
(AND (|bpListAndRecover| |ps| #'|bpSemiColon|)
- (|bpPush| |ps| (|bfSequence| (|bpPop1|)))))
+ (|bpPush| |ps| (|bfSequence| (|bpPop1| |ps|)))))
(DEFUN |bpBPileDefinition| (|ps|) (|bpPileBracketed| |ps| #'|bpPileItems|))
(DEFUN |bpIteratorTail| (|ps|)
- (AND (OR (|bpEqKey| 'REPEAT) T) (|bpIterators| |ps|)))
+ (AND (OR (|bpEqKey| |ps| 'REPEAT) T) (|bpIterators| |ps|)))
(DEFUN |bpConstruct| (|ps|) (|bpBracket| |ps| #'|bpConstruction|))
@@ -1051,8 +1093,8 @@
(AND (|bpComma| |ps|)
(OR
(AND (|bpIteratorTail| |ps|)
- (|bpPush| |ps| (|bfCollect| (|bpPop2|) (|bpPop1|))))
- (|bpPush| |ps| (|bfTupleConstruct| (|bpPop1|))))))
+ (|bpPush| |ps| (|bfCollect| (|bpPop2| |ps|) (|bpPop1| |ps|))))
+ (|bpPush| |ps| (|bfTupleConstruct| (|bpPop1| |ps|))))))
(DEFUN |bpDConstruct| (|ps|) (|bpBracket| |ps| #'|bpDConstruction|))
@@ -1060,39 +1102,39 @@
(AND (|bpComma| |ps|)
(OR
(AND (|bpIteratorTail| |ps|)
- (|bpPush| |ps| (|bfDCollect| (|bpPop2|) (|bpPop1|))))
- (|bpPush| |ps| (|bfDTuple| (|bpPop1|))))))
+ (|bpPush| |ps| (|bfDCollect| (|bpPop2| |ps|) (|bpPop1| |ps|))))
+ (|bpPush| |ps| (|bfDTuple| (|bpPop1| |ps|))))))
(DEFUN |bpPattern| (|ps|)
(OR (|bpBracketConstruct| |ps| #'|bpPatternL|) (|bpChar| |ps|)
(|bpName| |ps|) (|bpConstTok| |ps|)))
(DEFUN |bpEqual| (|ps|)
- (AND (|bpEqKey| 'SHOEEQ)
+ (AND (|bpEqKey| |ps| 'SHOEEQ)
(OR (|bpApplication| |ps|) (|bpConstTok| |ps|) (|bpTrap|))
- (|bpPush| |ps| (|bfEqual| (|bpPop1|)))))
+ (|bpPush| |ps| (|bfEqual| (|bpPop1| |ps|)))))
(DEFUN |bpRegularPatternItem| (|ps|)
(OR (|bpEqual| |ps|) (|bpConstTok| |ps|) (|bpDot| |ps|)
(AND (|bpName| |ps|)
(OR
- (AND (|bpEqKey| 'BEC) (|bpRequire| |ps| #'|bpPattern|)
- (|bpPush| |ps| (|bfAssign| (|bpPop2|) (|bpPop1|))))
+ (AND (|bpEqKey| |ps| 'BEC) (|bpRequire| |ps| #'|bpPattern|)
+ (|bpPush| |ps| (|bfAssign| (|bpPop2| |ps|) (|bpPop1| |ps|))))
T))
(|bpBracketConstruct| |ps| #'|bpPatternL|)))
(DEFUN |bpRegularPatternItemL| (|ps|)
- (AND (|bpRegularPatternItem| |ps|) (|bpPush| |ps| (LIST (|bpPop1|)))))
+ (AND (|bpRegularPatternItem| |ps|) (|bpPush| |ps| (LIST (|bpPop1| |ps|)))))
(DEFUN |bpRegularList| (|ps|)
(|bpListof| |ps| #'|bpRegularPatternItemL| 'COMMA #'|bfAppend|))
(DEFUN |bpPatternColon| (|ps|)
- (AND (|bpEqKey| 'COLON) (|bpRequire| |ps| #'|bpRegularPatternItem|)
- (|bpPush| |ps| (LIST (|bfColon| (|bpPop1|))))))
+ (AND (|bpEqKey| |ps| 'COLON) (|bpRequire| |ps| #'|bpRegularPatternItem|)
+ (|bpPush| |ps| (LIST (|bfColon| (|bpPop1| |ps|))))))
(DEFUN |bpPatternL| (|ps|)
- (AND (|bpPatternList| |ps|) (|bpPush| |ps| (|bfTuple| (|bpPop1|)))))
+ (AND (|bpPatternList| |ps|) (|bpPush| |ps| (|bfTuple| (|bpPop1| |ps|)))))
(DEFUN |bpPatternList| (|ps|)
(COND
@@ -1100,36 +1142,37 @@
(LOOP
(COND
((NOT
- (AND (|bpEqKey| 'COMMA)
+ (AND (|bpEqKey| |ps| 'COMMA)
(OR (|bpRegularPatternItemL| |ps|)
(PROGN
(OR
(AND (|bpPatternTail| |ps|)
- (|bpPush| |ps| (|append| (|bpPop2|) (|bpPop1|))))
+ (|bpPush| |ps|
+ (|append| (|bpPop2| |ps|) (|bpPop1| |ps|))))
(|bpTrap|))
NIL))))
(RETURN NIL))
- (T (|bpPush| |ps| (|append| (|bpPop2|) (|bpPop1|))))))
+ (T (|bpPush| |ps| (|append| (|bpPop2| |ps|) (|bpPop1| |ps|))))))
T)
(T (|bpPatternTail| |ps|))))
(DEFUN |bpPatternTail| (|ps|)
(AND (|bpPatternColon| |ps|)
(OR
- (AND (|bpEqKey| 'COMMA) (|bpRequire| |ps| #'|bpRegularList|)
- (|bpPush| |ps| (|append| (|bpPop2|) (|bpPop1|))))
+ (AND (|bpEqKey| |ps| 'COMMA) (|bpRequire| |ps| #'|bpRegularList|)
+ (|bpPush| |ps| (|append| (|bpPop2| |ps|) (|bpPop1| |ps|))))
T)))
(DEFUN |bpRegularBVItemTail| (|ps|)
(OR
- (AND (|bpEqKey| 'COLON) (|bpRequire| |ps| #'|bpApplication|)
- (|bpPush| |ps| (|bfTagged| (|bpPop2|) (|bpPop1|))))
- (AND (|bpEqKey| 'BEC) (|bpRequire| |ps| #'|bpPattern|)
- (|bpPush| |ps| (|bfAssign| (|bpPop2|) (|bpPop1|))))
- (AND (|bpEqKey| 'IS) (|bpRequire| |ps| #'|bpPattern|)
- (|bpPush| |ps| (|bfAssign| (|bpPop2|) (|bpPop1|))))
- (AND (|bpEqKey| 'DEF) (|bpRequire| |ps| #'|bpApplication|)
- (|bpPush| |ps| (|%DefaultValue| (|bpPop2|) (|bpPop1|))))))
+ (AND (|bpEqKey| |ps| 'COLON) (|bpRequire| |ps| #'|bpApplication|)
+ (|bpPush| |ps| (|bfTagged| (|bpPop2| |ps|) (|bpPop1| |ps|))))
+ (AND (|bpEqKey| |ps| 'BEC) (|bpRequire| |ps| #'|bpPattern|)
+ (|bpPush| |ps| (|bfAssign| (|bpPop2| |ps|) (|bpPop1| |ps|))))
+ (AND (|bpEqKey| |ps| 'IS) (|bpRequire| |ps| #'|bpPattern|)
+ (|bpPush| |ps| (|bfAssign| (|bpPop2| |ps|) (|bpPop1| |ps|))))
+ (AND (|bpEqKey| |ps| 'DEF) (|bpRequire| |ps| #'|bpApplication|)
+ (|bpPush| |ps| (|%DefaultValue| (|bpPop2| |ps|) (|bpPop1| |ps|))))))
(DEFUN |bpRegularBVItem| (|ps|)
(OR (|bpBVString| |ps|) (|bpConstTok| |ps|)
@@ -1139,13 +1182,14 @@
(DEFUN |bpBVString| (|ps|)
(DECLARE (SPECIAL |$ttok| |$stok|))
(AND (EQ (|tokenClass| |$stok|) 'STRING)
- (|bpPush| |ps| (LIST 'BVQUOTE (INTERN |$ttok|))) (|bpNext|)))
+ (|bpPush| |ps| (LIST 'BVQUOTE (INTERN |$ttok|))) (|bpNext| |ps|)))
(DEFUN |bpRegularBVItemL| (|ps|)
- (AND (|bpRegularBVItem| |ps|) (|bpPush| |ps| (LIST (|bpPop1|)))))
+ (AND (|bpRegularBVItem| |ps|) (|bpPush| |ps| (LIST (|bpPop1| |ps|)))))
(DEFUN |bpColonName| (|ps|)
- (AND (|bpEqKey| 'COLON) (OR (|bpName| |ps|) (|bpBVString| |ps|) (|bpTrap|))))
+ (AND (|bpEqKey| |ps| 'COLON)
+ (OR (|bpName| |ps|) (|bpBVString| |ps|) (|bpTrap|))))
(DEFUN |bpBoundVariablelist| (|ps|)
(COND
@@ -1153,26 +1197,27 @@
(LOOP
(COND
((NOT
- (AND (|bpEqKey| 'COMMA)
+ (AND (|bpEqKey| |ps| 'COMMA)
(OR (|bpRegularBVItemL| |ps|)
(PROGN
(OR
(AND (|bpColonName| |ps|)
(|bpPush| |ps|
- (|bfColonAppend| (|bpPop2|) (|bpPop1|))))
+ (|bfColonAppend| (|bpPop2| |ps|)
+ (|bpPop1| |ps|))))
(|bpTrap|))
NIL))))
(RETURN NIL))
- (T (|bpPush| |ps| (|append| (|bpPop2|) (|bpPop1|))))))
+ (T (|bpPush| |ps| (|append| (|bpPop2| |ps|) (|bpPop1| |ps|))))))
T)
(T
(AND (|bpColonName| |ps|)
- (|bpPush| |ps| (|bfColonAppend| NIL (|bpPop1|)))))))
+ (|bpPush| |ps| (|bfColonAppend| NIL (|bpPop1| |ps|)))))))
(DEFUN |bpVariable| (|ps|)
(OR
(AND (|bpParenthesized| |ps| #'|bpBoundVariablelist|)
- (|bpPush| |ps| (|bfTupleIf| (|bpPop1|))))
+ (|bpPush| |ps| (|bfTupleIf| (|bpPop1| |ps|))))
(|bpBracketConstruct| |ps| #'|bpPatternL|) (|bpName| |ps|)
(|bpConstTok| |ps|)))
@@ -1181,48 +1226,51 @@
(DEFUN |bpAssignLHS| (|ps|)
(COND ((NOT (|bpName| |ps|)) NIL)
- ((|bpEqKey| 'COLON) (|bpRequire| |ps| #'|bpApplication|)
- (|bpPush| |ps| (|bfLocal| (|bpPop2|) (|bpPop1|))))
+ ((|bpEqKey| |ps| 'COLON) (|bpRequire| |ps| #'|bpApplication|)
+ (|bpPush| |ps| (|bfLocal| (|bpPop2| |ps|) (|bpPop1| |ps|))))
(T
(AND (|bpArgumentList| |ps|)
(OR (|bpEqPeek| 'DOT)
(AND (|bpEqPeek| 'BEC)
- (|bpPush| |ps| (|bfPlace| (|bpPop1|))))
+ (|bpPush| |ps| (|bfPlace| (|bpPop1| |ps|))))
(|bpTrap|)))
(COND
- ((|bpEqKey| 'DOT)
+ ((|bpEqKey| |ps| 'DOT)
(AND (|bpList| |ps| #'|bpPrimary| 'DOT) (|bpChecknull| |ps|)
- (|bpPush| |ps| (|bfTuple| (CONS (|bpPop2|) (|bpPop1|))))))
+ (|bpPush| |ps|
+ (|bfTuple| (CONS (|bpPop2| |ps|) (|bpPop1| |ps|))))))
(T T)))))
(DEFUN |bpChecknull| (|ps|)
(LET* (|a|)
(PROGN
- (SETQ |a| (|bpPop1|))
+ (SETQ |a| (|bpPop1| |ps|))
(COND ((NULL |a|) (|bpTrap|)) (T (|bpPush| |ps| |a|))))))
(DEFUN |bpStruct| (|ps|)
- (AND (|bpEqKey| 'STRUCTURE) (|bpRequire| |ps| #'|bpName|)
- (OR (|bpEqKey| 'DEF) (|bpTrap|))
+ (AND (|bpEqKey| |ps| 'STRUCTURE) (|bpRequire| |ps| #'|bpName|)
+ (OR (|bpEqKey| |ps| 'DEF) (|bpTrap|))
(OR (|bpRecord| |ps|) (|bpTypeList| |ps|))
- (|bpPush| |ps| (|%Structure| (|bpPop2|) (|bpPop1|)))))
+ (|bpPush| |ps| (|%Structure| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(DEFUN |bpRecord| (|ps|)
(LET* (|s|)
(PROGN
- (SETQ |s| (|bpState|))
+ (SETQ |s| (|bpState| |ps|))
(COND
- ((AND (|bpName| |ps|) (EQ (|bpPop1|) '|Record|))
+ ((AND (|bpName| |ps|) (EQ (|bpPop1| |ps|) '|Record|))
(AND (OR (|bpParenthesized| |ps| #'|bpFieldList|) (|bpTrap|))
(|bpGlobalAccessors| |ps|)
- (|bpPush| |ps| (|%Record| (|bfUntuple| (|bpPop2|)) (|bpPop1|)))))
- (T (|bpRestore| |s|) NIL)))))
+ (|bpPush| |ps|
+ (|%Record| (|bfUntuple| (|bpPop2| |ps|))
+ (|bpPop1| |ps|)))))
+ (T (|bpRestore| |ps| |s|) NIL)))))
(DEFUN |bpFieldList| (|ps|) (|bpTuple| |ps| #'|bpSignature|))
(DEFUN |bpGlobalAccessors| (|ps|)
(COND
- ((|bpEqKey| 'WITH)
+ ((|bpEqKey| |ps| 'WITH)
(OR (|bpPileBracketed| |ps| #'|bpAccessorDefinitionList|) (|bpTrap|)))
(T (|bpPush| |ps| NIL))))
@@ -1230,17 +1278,17 @@
(|bpListAndRecover| |ps| #'|bpAccessorDefinition|))
(DEFUN |bpAccessorDefinition| (|ps|)
- (AND (|bpRequire| |ps| #'|bpName|) (OR (|bpEqKey| 'DEF) (|bpTrap|))
+ (AND (|bpRequire| |ps| #'|bpName|) (OR (|bpEqKey| |ps| 'DEF) (|bpTrap|))
(|bpRequire| |ps| #'|bpFieldSection|)
- (|bpPush| |ps| (|%AccessorDef| (|bpPop2|) (|bpPop1|)))))
+ (|bpPush| |ps| (|%AccessorDef| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(DEFUN |bpFieldSection| (|ps|) (|bpParenthesized| |ps| #'|bpSelectField|))
-(DEFUN |bpSelectField| (|ps|) (AND (|bpEqKey| 'DOT) (|bpName| |ps|)))
+(DEFUN |bpSelectField| (|ps|) (AND (|bpEqKey| |ps| 'DOT) (|bpName| |ps|)))
(DEFUN |bpTypeList| (|ps|)
(OR (|bpPileBracketed| |ps| #'|bpTypeItemList|)
- (AND (|bpTypeItem| |ps|) (|bpPush| |ps| (LIST (|bpPop1|))))))
+ (AND (|bpTypeItem| |ps|) (|bpPush| |ps| (LIST (|bpPop1| |ps|))))))
(DEFUN |bpTypeItem| (|ps|) (|bpTerm| |ps| #'|bpIdList|))
@@ -1251,20 +1299,20 @@
(AND (|bpRequire| |ps| #'|bpName|)
(OR
(AND (|bpParenthesized| |ps| |idListParser|)
- (|bpPush| |ps| (|bfNameArgs| (|bpPop2|) (|bpPop1|))))
+ (|bpPush| |ps| (|bfNameArgs| (|bpPop2| |ps|) (|bpPop1| |ps|))))
(AND (|bpName| |ps|)
- (|bpPush| |ps| (|bfNameArgs| (|bpPop2|) (|bpPop1|))))))
- (|bpPush| |ps| (|bfNameOnly| (|bpPop1|)))))
+ (|bpPush| |ps| (|bfNameArgs| (|bpPop2| |ps|) (|bpPop1| |ps|))))))
+ (|bpPush| |ps| (|bfNameOnly| (|bpPop1| |ps|)))))
(DEFUN |bpIdList| (|ps|) (|bpTuple| |ps| #'|bpName|))
(DEFUN |bpCase| (|ps|)
- (AND (|bpEqKey| 'CASE) (|bpRequire| |ps| #'|bpWhere|)
- (OR (|bpEqKey| 'OF) (|bpMissing| 'OF)) (|bpPiledCaseItems| |ps|)))
+ (AND (|bpEqKey| |ps| 'CASE) (|bpRequire| |ps| #'|bpWhere|)
+ (OR (|bpEqKey| |ps| 'OF) (|bpMissing| 'OF)) (|bpPiledCaseItems| |ps|)))
(DEFUN |bpPiledCaseItems| (|ps|)
(AND (|bpPileBracketed| |ps| #'|bpCaseItemList|)
- (|bpPush| |ps| (|bfCase| (|bpPop2|) (|bpPop1|)))))
+ (|bpPush| |ps| (|bfCase| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(DEFUN |bpCaseItemList| (|ps|) (|bpListAndRecover| |ps| #'|bpCaseItem|))
@@ -1274,8 +1322,8 @@
(DEFUN |bpCaseItem| (|ps|)
(AND (OR (|bpTerm| |ps| #'|bpCasePatternVarList|) (|bpTrap|))
- (OR (|bpEqKey| 'EXIT) (|bpTrap|)) (|bpRequire| |ps| #'|bpWhere|)
- (|bpPush| |ps| (|bfCaseItem| (|bpPop2|) (|bpPop1|)))))
+ (OR (|bpEqKey| |ps| 'EXIT) (|bpTrap|)) (|bpRequire| |ps| #'|bpWhere|)
+ (|bpPush| |ps| (|bfCaseItem| (|bpPop2| |ps|) (|bpPop1| |ps|)))))
(DEFUN |bpOutItem| (|ps|)
(LET* (|t| |r| |ISTMP#2| |l| |ISTMP#1| |b|)
@@ -1284,7 +1332,7 @@
(DECLARE (SPECIAL |$op| |$GenVarCounter|))
(PROGN
(|bpRequire| |ps| #'|bpComma|)
- (SETQ |b| (|bpPop1|))
+ (SETQ |b| (|bpPop1| |ps|))
(SETQ |t|
(COND ((AND (CONSP |b|) (EQ (CAR |b|) '+LINE)) (LIST |b|))
((AND (CONSP |b|) (EQ (CAR |b|) 'L%T)
diff --git a/src/boot/strap/translator.clisp b/src/boot/strap/translator.clisp
index d71a5351..a799d9fa 100644
--- a/src/boot/strap/translator.clisp
+++ b/src/boot/strap/translator.clisp
@@ -448,7 +448,7 @@
(SETQ |$returns| NIL)
(SETQ |$bpCount| 0)
(SETQ |$bpParenCount| 0)
- (|bpFirstTok|)
+ (|bpFirstTok| |ps|)
(SETQ |found|
(LET ((#1=#:G729
(CATCH :OPEN-AXIOM-CATCH-POINT (|bpOutItem| |ps|))))