diff options
author | dos-reis <gdr@axiomatics.org> | 2012-05-30 01:58:49 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2012-05-30 01:58:49 +0000 |
commit | 6c514c2fb12c51eeb5f7745c85736cdc97abfc7f (patch) | |
tree | a5318ea0ecfec51bf23d7bade7ff9a452c697498 /src/boot/strap | |
parent | 7ce6e4867ffda62855e183baceb02747408a86ca (diff) | |
download | open-axiom-6c514c2fb12c51eeb5f7745c85736cdc97abfc7f.tar.gz |
* boot/parser.boot: Remove references to $bpParentCount.
* boot/translator.boot (shoeOutParse): Likewise.
Diffstat (limited to 'src/boot/strap')
-rw-r--r-- | src/boot/strap/parser.clisp | 35 | ||||
-rw-r--r-- | src/boot/strap/translator.clisp | 5 |
2 files changed, 23 insertions, 17 deletions
diff --git a/src/boot/strap/parser.clisp b/src/boot/strap/parser.clisp index d96379e5..cf7c652c 100644 --- a/src/boot/strap/parser.clisp +++ b/src/boot/strap/parser.clisp @@ -65,7 +65,7 @@ T)) (DEFUN |bpFirstTok| (|ps|) - (DECLARE (SPECIAL |$bpCount| |$bpParenCount| |$ttok| |$stok|)) + (DECLARE (SPECIAL |$bpCount| |$ttok| |$stok|)) (PROGN (SETQ |$stok| (COND @@ -74,7 +74,7 @@ (T (CAR (|parserTokens| |ps|))))) (SETQ |$ttok| (|tokenValue| |$stok|)) (COND - ((AND (PLUSP |$bpParenCount|) (EQ (|tokenClass| |$stok|) 'KEY)) + ((AND (PLUSP (|parserNesting| |ps|)) (EQ (|tokenClass| |$stok|) 'KEY)) (COND ((EQ |$ttok| 'SETTAB) (SETQ |$bpCount| (+ |$bpCount| 1)) (|bpNext| |ps|)) ((EQ |$ttok| 'BACKTAB) (SETQ |$bpCount| (- |$bpCount| 1)) @@ -95,16 +95,17 @@ (DEFUN |bpRequire| (|ps| |f|) (OR (APPLY |f| |ps| NIL) (|bpTrap|))) (DEFUN |bpState| (|ps|) - (DECLARE (SPECIAL |$bpCount| |$bpParenCount|)) - (LIST (|parserTokens| |ps|) (|parserTrees| |ps|) |$bpParenCount| |$bpCount|)) + (DECLARE (SPECIAL |$bpCount|)) + (LIST (|parserTokens| |ps|) (|parserTrees| |ps|) (|parserNesting| |ps|) + |$bpCount|)) (DEFUN |bpRestore| (|ps| |x|) - (DECLARE (SPECIAL |$bpCount| |$bpParenCount|)) + (DECLARE (SPECIAL |$bpCount|)) (PROGN (SETF (|parserTokens| |ps|) (CAR |x|)) (|bpFirstToken| |ps|) (SETF (|parserTrees| |ps|) (CADR |x|)) - (SETQ |$bpParenCount| (CADDR |x|)) + (SETF (|parserNesting| |ps|) (CADDR |x|)) (SETQ |$bpCount| (CADDDR |x|)) T)) @@ -138,27 +139,31 @@ (DEFUN |bpIndentParenthesized| (|ps| |f|) (LET* (|a|) - (DECLARE (SPECIAL |$bpParenCount| |$stok|)) + (DECLARE (SPECIAL |$stok|)) (LET ((|$bpCount| 0)) (DECLARE (SPECIAL |$bpCount|)) (PROGN (SETQ |a| |$stok|) (COND - ((|bpEqPeek| 'OPAREN) (SETQ |$bpParenCount| (+ |$bpParenCount| 1)) + ((|bpEqPeek| 'OPAREN) + (SETF (|parserNesting| |ps|) (+ (|parserNesting| |ps|) 1)) (|bpNext| |ps|) (COND ((AND (APPLY |f| |ps| NIL) (|bpFirstTok| |ps|) (OR (|bpEqPeek| 'CPAREN) (|bpParenTrap| |a|))) - (SETQ |$bpParenCount| (- |$bpParenCount| 1)) (|bpNextToken| |ps|) + (SETF (|parserNesting| |ps|) (- (|parserNesting| |ps|) 1)) + (|bpNextToken| |ps|) (COND ((EQL |$bpCount| 0) T) (T (SETF (|parserTokens| |ps|) (|append| (|bpAddTokens| |$bpCount|) (|parserTokens| |ps|))) (|bpFirstToken| |ps|) - (COND ((EQL |$bpParenCount| 0) (|bpCancel| |ps|) T) (T T))))) + (COND ((EQL (|parserNesting| |ps|) 0) (|bpCancel| |ps|) T) + (T T))))) ((|bpEqPeek| 'CPAREN) (|bpPush| |ps| (|bfTuple| NIL)) - (SETQ |$bpParenCount| (- |$bpParenCount| 1)) (|bpNextToken| |ps|) T) + (SETF (|parserNesting| |ps|) (- (|parserNesting| |ps|) 1)) + (|bpNextToken| |ps|) T) (T (|bpParenTrap| |a|)))) (T NIL)))))) @@ -404,7 +409,7 @@ (|bpPush| |ps| (|reverse!| |b|))))) (DEFUN |bpMoveTo| (|ps| |n|) - (DECLARE (SPECIAL |$bpParenCount| |$bpCount|)) + (DECLARE (SPECIAL |$bpCount|)) (COND ((NULL (|parserTokens| |ps|)) T) ((|bpEqPeek| 'BACKTAB) (COND ((EQL |n| 0) T) @@ -414,9 +419,11 @@ (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|)) + (SETF (|parserNesting| |ps|) (+ (|parserNesting| |ps|) 1)) + (|bpMoveTo| |ps| |n|)) ((|bpEqPeek| 'CPAREN) (|bpNextToken| |ps|) - (SETQ |$bpParenCount| (- |$bpParenCount| 1)) (|bpMoveTo| |ps| |n|)) + (SETF (|parserNesting| |ps|) (- (|parserNesting| |ps|) 1)) + (|bpMoveTo| |ps| |n|)) (T (|bpNextToken| |ps|) (|bpMoveTo| |ps| |n|)))) (DEFUN |bpQualifiedName| (|ps|) diff --git a/src/boot/strap/translator.clisp b/src/boot/strap/translator.clisp index a77d32ee..623bd82f 100644 --- a/src/boot/strap/translator.clisp +++ b/src/boot/strap/translator.clisp @@ -434,8 +434,8 @@ (DEFUN |shoeOutParse| (|toks|) (LET* (|found| |ps|) (DECLARE - (SPECIAL |$bpParenCount| |$bpCount| |$returns| |$typings| |$wheredefs| - |$op| |$ttok| |$stok|)) + (SPECIAL |$bpCount| |$returns| |$typings| |$wheredefs| |$op| |$ttok| + |$stok|)) (PROGN (SETQ |ps| (|makeParserState| |toks|)) (SETQ |$stok| NIL) @@ -445,7 +445,6 @@ (SETQ |$typings| NIL) (SETQ |$returns| NIL) (SETQ |$bpCount| 0) - (SETQ |$bpParenCount| 0) (|bpFirstTok| |ps|) (SETQ |found| (LET ((#1=#:G729 |