aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/boot/ast.boot4
-rw-r--r--src/boot/parser.boot13
-rw-r--r--src/boot/strap/ast.clisp4
-rw-r--r--src/boot/strap/parser.clisp17
4 files changed, 12 insertions, 26 deletions
diff --git a/src/boot/ast.boot b/src/boot/ast.boot
index 7cbc5267..3a0703cc 100644
--- a/src/boot/ast.boot
+++ b/src/boot/ast.boot
@@ -147,10 +147,6 @@ bfGenSymbol()==
$GenVarCounter:=$GenVarCounter+1
INTERN(CONCAT ('"bfVar#",STRINGIMAGE $GenVarCounter))
-bfListOf: %List -> %List
-bfListOf x==
- x
-
bfColon: %Thing -> %List
bfColon x==
["COLON",x]
diff --git a/src/boot/parser.boot b/src/boot/parser.boot
index 233f3896..8d906c00 100644
--- a/src/boot/parser.boot
+++ b/src/boot/parser.boot
@@ -202,12 +202,12 @@ bpListofFun(f,h,g)==
$stack:=nil
while apply(h,nil) and (apply(f,nil) or bpTrap()) repeat 0
$stack:=[NREVERSE $stack,:a]
- bpPush FUNCALL(g, bfListOf [bpPop3(),bpPop2(),:bpPop1()])
+ bpPush FUNCALL(g, [bpPop3(),bpPop2(),:bpPop1()])
else
true
else false
-bpList(f,str1,g)==
+bpList(f,str1)==
if apply(f,nil)
then
if bpEqKey str1 and (apply(f,nil) or bpTrap())
@@ -216,10 +216,10 @@ bpList(f,str1,g)==
$stack:=nil
while bpEqKey str1 and (apply(f,nil) or bpTrap()) repeat 0
$stack:=[NREVERSE $stack,:a]
- bpPush FUNCALL(g, [bpPop3(),bpPop2(),:bpPop1()])
+ bpPush [bpPop3(),bpPop2(),:bpPop1()]
else
- bpPush FUNCALL(g, [bpPop1()])
- else bpPush FUNCALL(g, [])
+ bpPush [bpPop1()]
+ else bpPush nil
bpOneOrMore f==
apply(f,nil)=>
@@ -1112,8 +1112,7 @@ bpAssignVariable()==
bpAssignLHS()==
bpName() and (bpEqKey "COLON" and (bpApplication() or bpTrap())
and bpPush bfLocal(bpPop2(),bpPop1())
- or bpEqKey "DOT" and bpList(function bpPrimary,"DOT",
- function bfListOf)
+ or bpEqKey "DOT" and bpList(function bpPrimary,"DOT")
and bpChecknull() and
bpPush bfTuple([bpPop2(),:bpPop1()])
or true)
diff --git a/src/boot/strap/ast.clisp b/src/boot/strap/ast.clisp
index 45c5d440..8a355ff2 100644
--- a/src/boot/strap/ast.clisp
+++ b/src/boot/strap/ast.clisp
@@ -160,10 +160,6 @@
(SETQ |$GenVarCounter| (+ |$GenVarCounter| 1))
(INTERN (CONCAT "bfVar#" (STRINGIMAGE |$GenVarCounter|)))))
-(DECLAIM (FTYPE (FUNCTION (|%List|) |%List|) |bfListOf|))
-
-(DEFUN |bfListOf| (|x|) |x|)
-
(DECLAIM (FTYPE (FUNCTION (|%Thing|) |%List|) |bfColon|))
(DEFUN |bfColon| (|x|) (LIST 'COLON |x|))
diff --git a/src/boot/strap/parser.clisp b/src/boot/strap/parser.clisp
index 79c7e905..fc811e17 100644
--- a/src/boot/strap/parser.clisp
+++ b/src/boot/strap/parser.clisp
@@ -217,13 +217,11 @@
(SETQ |$stack| (CONS (NREVERSE |$stack|) |a|))
(|bpPush|
(FUNCALL |g|
- (|bfListOf|
- (CONS (|bpPop3|)
- (CONS (|bpPop2|) (|bpPop1|)))))))
+ (CONS (|bpPop3|) (CONS (|bpPop2|) (|bpPop1|))))))
(#0='T T)))
(#0# NIL)))))
-(DEFUN |bpList| (|f| |str1| |g|)
+(DEFUN |bpList| (|f| |str1|)
(PROG (|a|)
(DECLARE (SPECIAL |$stack|))
(RETURN
@@ -239,11 +237,9 @@
(RETURN NIL))
('T 0)))
(SETQ |$stack| (CONS (NREVERSE |$stack|) |a|))
- (|bpPush|
- (FUNCALL |g|
- (CONS (|bpPop3|) (CONS (|bpPop2|) (|bpPop1|))))))
- (#0='T (|bpPush| (FUNCALL |g| (LIST (|bpPop1|)))))))
- (#0# (|bpPush| (FUNCALL |g| NIL)))))))
+ (|bpPush| (CONS (|bpPop3|) (CONS (|bpPop2|) (|bpPop1|)))))
+ (#0='T (|bpPush| (LIST (|bpPop1|))))))
+ (#0# (|bpPush| NIL))))))
(DEFUN |bpOneOrMore| (|f|)
(PROG (|a|)
@@ -1139,8 +1135,7 @@
(AND (|bpName|)
(OR (AND (|bpEqKey| 'COLON) (OR (|bpApplication|) (|bpTrap|))
(|bpPush| (|bfLocal| (|bpPop2|) (|bpPop1|))))
- (AND (|bpEqKey| 'DOT)
- (|bpList| #'|bpPrimary| 'DOT #'|bfListOf|)
+ (AND (|bpEqKey| 'DOT) (|bpList| #'|bpPrimary| 'DOT)
(|bpChecknull|)
(|bpPush| (|bfTuple| (CONS (|bpPop2|) (|bpPop1|)))))
T)))