aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/anarres/cpp/LexerSource.java
diff options
context:
space:
mode:
authorShevek <[email protected]>2009-03-31 13:15:12 +0000
committerShevek <[email protected]>2009-03-31 13:15:12 +0000
commit5b560840be18a2920f77752925f0882fabe6422c (patch)
tree68f49f13857ec7c492411ea1d1c416044900bc28 /src/java/org/anarres/cpp/LexerSource.java
parent15ab0955dd6da2ff0bdad791b190a93039e8edbd (diff)
Fix comments in macros. Fix EOF killing jcpp. Allow macros after whitespace.
Diffstat (limited to 'src/java/org/anarres/cpp/LexerSource.java')
-rw-r--r--src/java/org/anarres/cpp/LexerSource.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/java/org/anarres/cpp/LexerSource.java b/src/java/org/anarres/cpp/LexerSource.java
index 22df78f..d252569 100644
--- a/src/java/org/anarres/cpp/LexerSource.java
+++ b/src/java/org/anarres/cpp/LexerSource.java
@@ -288,7 +288,7 @@ public class LexerSource extends Source {
LexerException {
int d = read();
switch (d) {
- case 'a': text.append('a'); return 0x0a;
+ case 'a': text.append('a'); return 0x07;
case 'b': text.append('b'); return '\b';
case 'f': text.append('f'); return '\f';
case 'n': text.append('n'); return '\n';
@@ -791,7 +791,16 @@ public class LexerSource extends Source {
}
}
- bol = false;
+ if (bol) {
+ switch (tok.getType()) {
+ case WHITESPACE:
+ case CCOMMENT:
+ break;
+ default:
+ bol = false;
+ break;
+ }
+ }
tok.setLocation(_l, _c);
if (DEBUG)