diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 10 | ||||
-rw-r--r-- | src/doc/msgs/s2-us.msgs | 3 | ||||
-rw-r--r-- | src/interp/int-top.boot | 4 | ||||
-rw-r--r-- | src/interp/msg.boot | 5 | ||||
-rw-r--r-- | src/interp/scan.boot | 27 |
5 files changed, 33 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 10764537..4ef10c4c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2009-04-08 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * interp/scan.boot (scanCheckRadix): Take the radix in string form. + Croak on missing digit after radix. + (scanNumber): Don't ask for implicit 0 completion for explicit + radix integers. + * interp/int-top.boot (phInterpret): Don't bother evaluating + expressions if earlier phases saw errors. + * interp/msg.boot (getStFromMsg): Fix typo. + 2009-04-06 Gabriel Dos Reis <gdr@cs.tamu.edu> * boot/ast.boot: Support more ISO C sized integer type in FFI. diff --git a/src/doc/msgs/s2-us.msgs b/src/doc/msgs/s2-us.msgs index 5774dbd8..6ded51c7 100644 --- a/src/doc/msgs/s2-us.msgs +++ b/src/doc/msgs/s2-us.msgs @@ -1272,6 +1272,9 @@ S2CN0002 S2CN0003 The character %b %1 %d is not an OpenAxiom character. +S2CN0004 + Missing digit after the radix %1b specifier. + S2CY0002 Improper syntax. diff --git a/src/interp/int-top.boot b/src/interp/int-top.boot index 8c7df1e8..06366706 100644 --- a/src/interp/int-top.boot +++ b/src/interp/int-top.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2008, Gabriel Dos Reis. +-- Copyright (C) 2007-2009, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -247,6 +247,8 @@ intloopSpadProcess(stepNo,lines,ptree,interactive?)== stepNo+1 phInterpret carrier == + -- Don't try evaluation if the data structure may have been corrupted. + not ncEltQ(carrier, "ok?") => "KO" ptree := ncEltQ(carrier, 'ptree) val := intInterpretPform(ptree) ncPutQ(carrier, 'value, val) diff --git a/src/interp/msg.boot b/src/interp/msg.boot index 4f658fd2..af1532f9 100644 --- a/src/interp/msg.boot +++ b/src/interp/msg.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2008, Gabriel Dos Reis. +-- Copyright (C) 2007-2009, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -349,8 +349,7 @@ getStFromMsg msg == setOptKeyBlanks() preStL := getPreStL getMsgPrefix? msg getMsgTag msg = 'line => - [$optKeyBlanks, '"%1" , :preStL,_ - getMsgText msg] + [$optKeyBlanks, :preStL, getMsgText msg] posStL := getPosStL msg optKey := $showKeyNum => diff --git a/src/interp/scan.boot b/src/interp/scan.boot index eff296bf..77f5bdc4 100644 --- a/src/interp/scan.boot +++ b/src/interp/scan.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2008, Gabriel Dos Reis. +-- Copyright (C) 2007-2009, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -585,14 +585,17 @@ spleI1(dig,zro) == bb:=spleI1(dig,zro)-- escape, anyno spaces are ignored CONCAT(str,bb) -scanCheckRadix(r,w)== - ns:=#w - done:=false - for i in 0..ns-1 repeat - a:=rdigit? w.i - if null a or a>=r - then ncSoftError(cons($linepos,lnExtraBlanks $linepos+$n-ns+i), - "S2CN0002", [w.i]) +scanCheckRadix(a,w)== + r := PARSE_-INTEGER a + ns:=#w + ns = 0 => + ncSoftError([$linepos,:lnExtraBlanks $linepos+$n],"S2CN0004",[a]) + done:=false + for i in 0..ns-1 repeat + a:=rdigit? w.i + if null a or a>=r + then ncSoftError(cons($linepos,lnExtraBlanks $linepos+$n-ns+i), + "S2CN0002", [w.i]) scanNumber() == a := spleI(function digit?) @@ -615,8 +618,8 @@ scanNumber() == else lfinteger a else $n:=$n+1 - w:=spleI1(function rdigit?,true) - scanCheckRadix(PARSE_-INTEGER a,w) + w:=spleI1(function rdigit?,false) + scanCheckRadix(a,w) if $n>=$sz then lfrinteger(a,w) @@ -631,7 +634,7 @@ scanNumber() == else --$n:=$n+1 v:=spleI1(function rdigit?,true) - scanCheckRadix(PARSE_-INTEGER a,v) + scanCheckRadix(a,v) scanExponent(CONCAT(a,'"r",w),v) else lfrinteger(a,w) |