From e9d8606f86600b7d581f93f346981bca1f291dc7 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Thu, 12 Jan 2012 02:11:38 +0000 Subject: * boot/tokens.boot (keywordId): New. * boot/parser.boot (bpSexpKey): Use it. * interp/i-map.boot (mapPredTran): Fix thinko. --- src/boot/parser.boot | 6 +++--- src/boot/tokens.boot | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src/boot') 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) -- cgit v1.2.3