From 5b560840be18a2920f77752925f0882fabe6422c Mon Sep 17 00:00:00 2001 From: Shevek Date: Tue, 31 Mar 2009 13:15:12 +0000 Subject: Fix comments in macros. Fix EOF killing jcpp. Allow macros after whitespace. --- src/java/org/anarres/cpp/LexerSource.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/java/org/anarres/cpp/LexerSource.java') 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) -- cgit v1.2.3