From a50eb601b4dc0699cde4084584763798ee8dab02 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 20 Sep 2009 04:30:17 +0000 Subject: * 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. --- src/interp/cattable.boot | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/interp/cattable.boot') diff --git a/src/interp/cattable.boot b/src/interp/cattable.boot index 25c909b7..2c8129b8 100644 --- a/src/interp/cattable.boot +++ b/src/interp/cattable.boot @@ -96,19 +96,19 @@ simpHasPred(pred,:options) == main where simp pred == pred is [op,:r] => op = "has" => simpHas(pred,first r,first rest r) - op = 'HasCategory => simp ['has,CAR r,simpDevaluate CADR r] + op = 'HasCategory => simp ["has",CAR r,simpDevaluate CADR r] op = 'HasSignature => [op,sig] := simpDevaluate CADR r ["has",CAR r,['SIGNATURE,op,sig]] op = 'HasAttribute => - form := ['has,a := CAR r,['ATTRIBUTE,b := simpDevaluate CADR r]] + form := ["has",a := CAR r,['ATTRIBUTE,b := simpDevaluate CADR r]] simpHasAttribute(form,a,b) MEMQ(op,'(AND OR NOT)) => null (u := MKPF([simp p for p in r],op)) => nil u is '(QUOTE T) => true simpBool u op = 'hasArgs => ($hasArgs => $hasArgs = r; pred) - null r and opOf op = 'has => simp first pred + null r and opOf op = "has" => simp first pred pred is '(QUOTE T) => true op1 := LASSOC(op,'((and . AND)(or . OR)(not . NOT))) => simp [op1,:r] simp first pred --REMOVE THIS HACK !!!! @@ -123,7 +123,7 @@ simpHasPred(pred,:options) == main where npred := eval pred IDENTP npred or null hasIdent npred => npred pred - eval (pred := ['has,d,cat]) == + eval (pred := ["has",d,cat]) == x := hasCat(CAR d,CAR cat) y := CDR cat => npred := or/[p for [args,:p] in x | y = args] => simp npred @@ -233,7 +233,7 @@ encodeUnion(id,new:=[a,:b],alist) == moreGeneralCategoryPredicate(id,new,old) == old = 'T or new = 'T => 'T - old is ['has,a,b] and new is ['has,=a,c] => + old is ["has",a,b] and new is ["has",=a,c] => tempExtendsCat(b,c) => new tempExtendsCat(c,b) => old ['OR,old,new] @@ -246,10 +246,10 @@ mkCategoryOr(new,old) == simpCategoryOr(new,l) == newExtendsAnOld:= false anOldExtendsNew:= false - ['has,a,b] := new + ["has",a,b] := new newList:= nil for pred in l repeat - pred is ['has,=a,c] => + pred is ["has",=a,c] => tempExtendsCat(c,b) => anOldExtendsNew:= true if tempExtendsCat(b,c) then newExtendsAnOld:= true newList:= [pred,:newList] @@ -331,7 +331,7 @@ simpOrUnion1(x,l) == [first l,:simpOrUnion1(x,rest l)] mergeOr(x,y) == - x is ["has",a,b] and y is ['has,=a,c] => + x is ["has",a,b] and y is ["has",=a,c] => testExtend(b,c) => y testExtend(c,b) => x nil @@ -356,12 +356,12 @@ getConstrCat(x) == makeCatPred(zz, cats, thePred) == - if zz is ['IF,curPred := ['has,z1,z2],ats,.] then + if zz is ['IF,curPred := ["has",z1,z2],ats,.] then ats := if ats is ['PROGN,:atl] then atl else [ats] for at in ats repeat if at is ['ATTRIBUTE,z3] and not atom z3 and constructor? CAR z3 then - cats:= CONS(['IF,quickAnd(['has,z1,z2], thePred),z3,'%noBranch],cats) + cats:= CONS(['IF,quickAnd(["has",z1,z2], thePred),z3,'%noBranch],cats) at is ['IF, pred, :.] => cats := makeCatPred(at, cats, curPred) cats -- cgit v1.2.3