aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorShevek <[email protected]>2014-09-08 17:17:08 -0700
committerShevek <[email protected]>2014-09-08 17:17:08 -0700
commit09e951892e640874756690d3e9f7d07613b4f67b (patch)
tree8a522db3783b9e7d16264e973e4134d2b2694ce5 /src/main
parenta7b9e5655b6521c6e8f3e37b83dcdfa63cb3e9b8 (diff)
Fix #15.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/anarres/cpp/LexerSource.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/org/anarres/cpp/LexerSource.java b/src/main/java/org/anarres/cpp/LexerSource.java
index 0b381b9..d9331fe 100644
--- a/src/main/java/org/anarres/cpp/LexerSource.java
+++ b/src/main/java/org/anarres/cpp/LexerSource.java
@@ -262,10 +262,16 @@ public class LexerSource extends Source {
do {
do {
d = read();
+ if (d == -1)
+ return new Token(INVALID, text.toString(),
+ "Unterminated comment");
text.append((char) d);
} while (d != '*');
do {
d = read();
+ if (d == -1)
+ return new Token(INVALID, text.toString(),
+ "Unterminated comment");
text.append((char) d);
} while (d == '*');
} while (d != '/');