aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/interp/pf2sex.boot7
-rw-r--r--src/interp/scan.boot12
3 files changed, 23 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e69de29b..4c92874a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -0,0 +1,6 @@
+2009-01-01 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * interp/pf2sex.boot (pfLiteral2Sex): Fix evaluation of intergers
+ with non-decimal radix.
+ * interp/scan.boot (rdigti?): Allow non-capital letters.
+
diff --git a/src/interp/pf2sex.boot b/src/interp/pf2sex.boot
index 56539978..c675054e 100644
--- a/src/interp/pf2sex.boot
+++ b/src/interp/pf2sex.boot
@@ -181,7 +181,12 @@ pf2Sex1 pf ==
pfLiteral2Sex pf ==
type := pfLiteralClass pf
type = 'integer =>
- READ_-FROM_-STRING pfLiteralString pf
+ txt := pfLiteralString pf
+ MULTIPLE_-VALUE_-BIND(part1 pos1,
+ PARSE_-INTEGER(txt,KEYWORD::JUNK_-ALLOWED,true),
+ if pos1 = #txt then part1
+ else PARSE_-INTEGER(SUBSTRING(txt,pos1+1,nil),
+ KEYWORD::RADIX, part1))
type = 'string or type = 'char =>
pfLiteralString pf
type = 'float =>
diff --git a/src/interp/scan.boot b/src/interp/scan.boot
index 557be8f8..674fe05e 100644
--- a/src/interp/scan.boot
+++ b/src/interp/scan.boot
@@ -38,6 +38,14 @@ import incl
namespace BOOT
module scan
+--%
+
+$RDigits ==
+ '"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+
+$smallLetters ==
+ '"abcdefghijklmnopqrstuvwxyz"
+
--% Separators
$SPACE == QENUM('" ", 0)
@@ -665,7 +673,9 @@ scanExponent(a,w)==
else lffloat(a,w,'"0")
rdigit? x==
- STRPOS(x,'"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",0,nil)
+ d := STRPOS(x,$RDigits,0,nil) => d
+ d := STRPOS(x,$smallLetters,0,nil) => 10 + d
+ nil
scanError()==
n:=$n