aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/anarres/cpp/LexerSource.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/anarres/cpp/LexerSource.java b/src/main/java/org/anarres/cpp/LexerSource.java
index ca18314..5f1dac3 100644
--- a/src/main/java/org/anarres/cpp/LexerSource.java
+++ b/src/main/java/org/anarres/cpp/LexerSource.java
@@ -587,11 +587,13 @@ public class LexerSource extends Source {
NumericValue value = new NumericValue(10, integer);
int d = read();
if (d == '.') {
+ text.append((char) d);
String fraction = _number_part(text, 10);
value.setFractionalPart(fraction);
d = read();
}
if (d == 'E' || d == 'e') {
+ text.append((char) d);
String exponent = _number_part(text, 10);
value.setExponent(exponent);
d = read();
@@ -847,7 +849,11 @@ public class LexerSource extends Source {
d = read();
if (d == 'x' || d == 'X')
tok = number_hex((char) d);
- else {
+ else if (d == '.') {
+ unread(d);
+ unread(c);
+ tok = number_decimal();
+ } else {
unread(d);
tok = number_octal();
}