diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2003-12-20 23:43:39 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2003-12-20 23:43:39 +0000 |
commit | 1a1b9d2feccc15e1bd1a26ff7a7709630d478fe8 (patch) | |
tree | bb44f7e1845acf7976503f3cd0f25f17ea476f37 /src/main/javassist/compiler/Lex.java | |
parent | 8e20f83d119aef0c906488cd87c7f665fbc3daf6 (diff) | |
download | javassist-1a1b9d2feccc15e1bd1a26ff7a7709630d478fe8.tar.gz javassist-1a1b9d2feccc15e1bd1a26ff7a7709630d478fe8.zip |
Fixed a bug of the token analyzer (double constant).
Improved compilation speed.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@58 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/compiler/Lex.java')
-rw-r--r-- | src/main/javassist/compiler/Lex.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/javassist/compiler/Lex.java b/src/main/javassist/compiler/Lex.java index baf4742e..76a22fdf 100644 --- a/src/main/javassist/compiler/Lex.java +++ b/src/main/javassist/compiler/Lex.java @@ -293,7 +293,8 @@ public class Lex implements TokenId { token.doubleValue = (double)value; return FloatConstant; } - else if (c2 == 'E' || c2 == 'e' || c2 == '.') { + else if (c2 == 'E' || c2 == 'e' + || c2 == 'D' || c2 == 'd' || c2 == '.') { StringBuffer tbuf = textBuffer; tbuf.setLength(0); tbuf.append(value); @@ -308,7 +309,7 @@ public class Lex implements TokenId { } private int readDouble(StringBuffer sbuf, int c, Token token) { - if (c != 'E' && c != 'e') { + if (c != 'E' && c != 'e' && c != 'D' && c != 'd') { sbuf.append((char)c); for (;;) { c = getc(); @@ -343,7 +344,9 @@ public class Lex implements TokenId { if (c == 'F' || c == 'f') return FloatConstant; else { - ungetc(c); + if (c != 'D' && c != 'd') + ungetc(c); + return DoubleConstant; } } |