diff options
author | dos-reis <gdr@axiomatics.org> | 2009-09-20 04:30:17 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2009-09-20 04:30:17 +0000 |
commit | a50eb601b4dc0699cde4084584763798ee8dab02 (patch) | |
tree | 540011a51f4396a3362cb066445c2fd250659b54 /src/boot/ast.boot | |
parent | 0c55ed614187758d4e0a670fc4f031d5f4ad7e4e (diff) | |
download | open-axiom-a50eb601b4dc0699cde4084584763798ee8dab02.tar.gz |
* boot/tokens.boot: "has" is not a keyword.
* boot/ast.boot (bfHas): New.
(bfReduce): Use "has" instead "has".
(bfReduceCollect): Likewise.
(bfReName): Likewise.
(bfElt): Likewise.
(bfSetelt): Likewise.
* boot/parser.boot (bpSexpKey): Likewise.
(bpPrefixOperator): Likewise.
(bpInfixOperator): Likewise.
(bpThetaName): Likewise.
(bpIs): Parse "has" expressions.
* boot/pile.boot (shoePileCoagulate): Likewise.
* interp/: Fix unquoted use of "has".
* interp/interop.boot (has): Remove.
Diffstat (limited to 'src/boot/ast.boot')
-rw-r--r-- | src/boot/ast.boot | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/boot/ast.boot b/src/boot/ast.boot index c83e95c6..0e7b50a8 100644 --- a/src/boot/ast.boot +++ b/src/boot/ast.boot @@ -335,7 +335,7 @@ bfReduce(op,y)== op is ["QUOTE",:.] => second op op op := bfReName a - init := GET(a,"SHOETHETA") or GET(op,"SHOETHETA") + init := a has SHOETHETA or op has SHOETHETA g := bfGenSymbol() g1 := bfGenSymbol() body := ['SETQ,g,[op,g,g1]] @@ -357,7 +357,7 @@ bfReduceCollect(op,y)== op is ["QUOTE",:.] => second op op op := bfReName a - init := GET(a, "SHOETHETA") or GET(op,"SHOETHETA") + init := a has SHOETHETA or op has SHOETHETA bfOpReduce(op,init,body,itl) bfReduce(op,bfTupleConstruct (y.1)) @@ -666,14 +666,19 @@ bfIS1(lhs,rhs) == bfAND [rev,:l2,['PROGN,bfLetForm(a,['NREVERSE,a]),'T]] bpSpecificErrorHere '"bad IS code is generated" bpTrap() - + + +bfHas(expr,prop) == + IDENTP prop => ["GET",expr,["QUOTE",prop]] + bpSpecificErrorAtToken('"expected identifier as property name") + bfApplication(bfop, bfarg) == bfTupleP bfarg => [bfop,:rest bfarg] [bfop,bfarg] -- returns the meaning of x in the appropriate Boot dialect. bfReName x== - a := GET(x,"SHOERENAME") => first a + a := x has SHOERENAME => first a x bfInfApplication(op,left,right)== @@ -932,14 +937,14 @@ bfSetelt(e,l,r)== bfSetelt(bfElt(e,first l),rest l,r) bfElt(expr,sel)== - y:=SYMBOLP sel and GET(sel,"SHOESELFUNCTION") + y:=SYMBOLP sel and sel has SHOESELFUNCTION y => INTEGERP y => ["ELT",expr,y] [y,expr] ["ELT",expr,sel] defSETELT(var,sel,expr)== - y := SYMBOLP sel and GET(sel,"SHOESELFUNCTION") + y := SYMBOLP sel and sel has SHOESELFUNCTION y => INTEGERP y => ["SETF",["ELT",var,y],expr] ["SETF",[y,var],expr] |