aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog6
-rw-r--r--src/boot/parser.boot6
-rw-r--r--src/boot/tokens.boot5
-rw-r--r--src/interp/i-map.boot4
4 files changed, 16 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 02101e4f..21d8c56a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-11 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * boot/tokens.boot (keywordId): New.
+ * boot/parser.boot (bpSexpKey): Use it.
+ * interp/i-map.boot (mapPredTran): Fix thinko.
+
2012-01-09 Gabriel Dos Reis <gdr@cs.tamu.edu>
* boot/parser.boot (bpRequire): New. Use it throughout this module.
diff --git a/src/boot/parser.boot b/src/boot/parser.boot
index 3aee7371..a7706e9a 100644
--- a/src/boot/parser.boot
+++ b/src/boot/parser.boot
@@ -549,15 +549,15 @@ bpExceptions()==
bpSexpKey()==
- $stok is ["KEY",:.] and not bpExceptions()=>
+ $stok is ["KEY",:.] and not bpExceptions() =>
a := $ttok has SHOEINF
- a = nil => bpPush $ttok and bpNext()
+ a = nil => bpPush keywordId $ttok and bpNext()
bpPush a and bpNext()
false
bpAnyId()==
bpEqKey "MINUS" and ($stok is ["INTEGER",:.] or bpTrap()) and
- bpPush MINUS $ttok and bpNext() or
+ bpPush(-$ttok) and bpNext() or
bpSexpKey() or
shoeTokType $stok in '(ID INTEGER STRING FLOAT)
and bpPush $ttok and bpNext()
diff --git a/src/boot/tokens.boot b/src/boot/tokens.boot
index e8909318..a008556c 100644
--- a/src/boot/tokens.boot
+++ b/src/boot/tokens.boot
@@ -132,6 +132,11 @@ shoeKeyTableCons()==
shoeKeyTable:=shoeKeyTableCons()
+keywordId t ==
+ s := or/[k for [k,:v] in entries shoeKeyTable | symbolEq?(v,t)] =>
+ makeSymbol s
+ t
+
shoeInsert(s,d) ==
l := #s
h := codePoint stringChar(s,0)
diff --git a/src/interp/i-map.boot b/src/interp/i-map.boot
index 2ee7de1c..33d78c0f 100644
--- a/src/interp/i-map.boot
+++ b/src/interp/i-map.boot
@@ -992,8 +992,8 @@ mkSharpVar i ==
mapPredTran pred ==
-- transforms "x in i..j" to "x>=i and x<=j"
- pred is ['in,var,['SEGMENT,lb]] => mkLessOrEqual(lb,var)
- pred is ['in,var,['SEGMENT,lb,ub]] =>
+ pred is ['IN,var,['SEGMENT,lb]] => mkLessOrEqual(lb,var)
+ pred is ['IN,var,['SEGMENT,lb,ub]] =>
null ub => mkLessOrEqual(lb,var)
['and,mkLessOrEqual(lb,var),mkLessOrEqual(var,ub)]
pred