]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lex.c (yylex): Recognize floating point constants with leading 0.
authorTom Tromey <tromey@cygnus.com>
Mon, 20 Nov 2000 22:32:40 +0000 (22:32 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Mon, 20 Nov 2000 22:32:40 +0000 (22:32 +0000)
* lex.c (yylex): Recognize floating point constants with leading
0.

From-SVN: r37593

gcc/java/ChangeLog
gcc/java/lex.c

index 02a5e6c90d99959ae2d1f2eb3b18f19ad55e7e90..17883ef9f8432feb1f0d31593b0183febba55f43 100644 (file)
@@ -1,3 +1,8 @@
+2000-11-20  Tom Tromey  <tromey@cygnus.com>
+
+       * lex.c (yylex): Recognize floating point constants with leading
+       0.
+
 2000-11-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * java-tree.h (cyclic_inheritance_report): Constify.
index 1b8898c604cb5bf4e49d3f11833762da88140507..eb4f1655be37544bd098dc5b80f66611fdf098d0 100644 (file)
@@ -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 (;;)
            {