aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/interp/cparse.boot14
-rw-r--r--src/interp/pf2sex.boot5
-rw-r--r--src/interp/ptrees.boot14
4 files changed, 23 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bd262eab..463e45cb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,15 @@
2010-05-22 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/ptrees.boot (pfWith): Now a function of two arguments.
+ (pfWithWithon): Remove.
+ (pfDefinableName?): New.
+ (pfCheckItOut): Use it.
+ * interp/cparse.boot (npWith): Simplify.
+ * interp/pf2sex.boot (pfWith2Sex): Adjust.
+ (pfAdd2Sex): Tidy.
+
+2010-05-22 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/cparse.boot (npQuiver): Redefine. Now send Application
to Application.
(npTypedForm): Replace Application with Quiver.
diff --git a/src/interp/cparse.boot b/src/interp/cparse.boot
index ab364fc7..11118d31 100644
--- a/src/interp/cparse.boot
+++ b/src/interp/cparse.boot
@@ -826,17 +826,9 @@ npDefaultValue()==
(npDefinitionOrStatement() or npTrap()) and
npPush [pfAdd(pfNothing(),npPop1(),pfNothing())]
-npWith(extra)==
- npEqKey "WITH" =>
- a := npState()
- npCategoryL() or npTrap()
- npEqPeek "IN" =>
- npRestore a
- (npVariable() or npTrap()) and
- npCompMissing "IN" and
- (npCategoryL() or npTrap()) and
- npPush pfWith(npPop2(),npPop1(),extra)
- npPush pfWith(pfNothing(),npPop1(),extra)
+npWith extra ==
+ npEqKey "WITH" and (npCategoryL() or npTrap()) and
+ npPush pfWith(extra,npPop1())
npCategoryL()==
npCategory() and npPush pfUnSequence npPop1 ()
diff --git a/src/interp/pf2sex.boot b/src/interp/pf2sex.boot
index 58e11767..2735580e 100644
--- a/src/interp/pf2sex.boot
+++ b/src/interp/pf2sex.boot
@@ -510,11 +510,10 @@ pfDoc2SexOrNil pf ==
pfWith2Sex pf ==
["%With", pfType2SexOrNil pfWithBase pf,
- [pf2Sex1 s for s in pf0WithWithin pf],
- pfType2SexOrNil pfWithWithon pf]
+ [pf2Sex1 s for s in pf0WithWithin pf]]
pfAdd2Sex pf ==
- ["%Add", pf2Sex1 pfAddBase pf, pf2Sex1 pfAddAddin pf,
+ ["%Add", pfType2SexOrNil pfAddBase pf, pf2Sex1 pfAddAddin pf,
pfType2SexOrNil pfAddAddon pf]
pfWDeclare2Sex pf ==
diff --git a/src/interp/ptrees.boot b/src/interp/ptrees.boot
index 1d3848ee..06ff0b65 100644
--- a/src/interp/ptrees.boot
+++ b/src/interp/ptrees.boot
@@ -96,6 +96,9 @@ pfDocument strings == pfLeaf('Document, strings)
pfDocument? form == pfAbSynOp?(form, 'Document)
pfDocumentText form == tokPart form
+pfDefinableName? form ==
+ pfAbSynOp form in '(id integer)
+
pfLiteral? form ==
pfAbSynOp form in '(integer symbol expression one zero char string float)
@@ -304,12 +307,11 @@ pfDWhereExpr pf == third pf -- was ==>
-- With := (Base: [Typed], Within: [WithPart])
-pfWith(pfbase, pfwithin,pfwithon) ==
- pfTree('With, [pfbase, pfwithin,pfwithon])
+pfWith(pfbase, pfwithin) ==
+ pfTree('With, [pfbase,pfwithin])
pfWith?(pf) == pfAbSynOp? (pf, 'With)
-pfWithBase pf == second pf -- was ==>
-pfWithWithin pf == third pf -- was ==>
-pfWithWithon pf == fourth pf -- was ==>
+pfWithBase pf == second pf
+pfWithWithin pf == third pf
pf0WithBase pf == pfParts pfWithBase pf
pf0WithWithin pf == pfParts pfWithWithin pf
@@ -700,7 +702,7 @@ pfPushBody(t,args,body)==
pfCheckItOut x ==
rt:=if pfTagged? x then pfTaggedExpr x else pfNothing()
form:= if pfTagged? x then pfTaggedTag x else x
- pfId? form => [pfListOf [pfTyped(form,rt)],nil,rt]
+ pfDefinableName? form => [pfListOf [pfTyped(form,rt)],nil,rt]
pfCollect1? form =>
[pfListOf [pfCollectVariable1 form],nil,rt]
pfTuple? form =>