aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/lex.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>2000-11-20 22:32:40 +0000
committerTom Tromey <tromey@gcc.gnu.org>2000-11-20 22:32:40 +0000
commit4e7842a01ee60d854ae144884e13fbdfe95a7fce (patch)
treeb9bfaf038731bf8c2f5ca8bc3e2a560caa3e7cc5 /gcc/java/lex.c
parent21bc13c936084bbcbb39e997db698f0e51fe4a85 (diff)
downloadgcc-4e7842a01ee60d854ae144884e13fbdfe95a7fce.zip
gcc-4e7842a01ee60d854ae144884e13fbdfe95a7fce.tar.gz
gcc-4e7842a01ee60d854ae144884e13fbdfe95a7fce.tar.bz2
lex.c (yylex): Recognize floating point constants with leading 0.
* lex.c (yylex): Recognize floating point constants with leading 0. From-SVN: r37593
Diffstat (limited to 'gcc/java/lex.c')
-rw-r--r--gcc/java/lex.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/java/lex.c b/gcc/java/lex.c
index 1b8898c..eb4f165 100644
--- a/gcc/java/lex.c
+++ b/gcc/java/lex.c
@@ -1024,8 +1024,12 @@ java_lex (java_lval)
int seen_exponent = 0;
int fflag = 0; /* 1 for {f,F}, 0 for {d,D}. FP literal are
double unless specified. */
- if (radix != 10)
+
+ /* It is ok if the radix is 8 because this just means we've
+ seen a leading `0'. However, radix==16 is invalid. */
+ if (radix == 16)
java_lex_error ("Can't express non-decimal FP literal", 0);
+ radix = 10;
for (;;)
{