diff options
author | Shevek <[email protected]> | 2009-04-08 12:24:53 +0000 |
---|---|---|
committer | Shevek <[email protected]> | 2009-04-08 12:24:53 +0000 |
commit | 130f6b820dcb1a835b7bd9333f0cb9702793e262 (patch) | |
tree | 155f0f68ba65c56ca7d588ff9c33f0910a2ecc53 /src/java/org/anarres/cpp/MacroTokenSource.java | |
parent | d46bffd718bb44013c981d4f29bd8d58b39bd3b6 (diff) |
fix widening macro case
Diffstat (limited to 'src/java/org/anarres/cpp/MacroTokenSource.java')
-rw-r--r-- | src/java/org/anarres/cpp/MacroTokenSource.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/java/org/anarres/cpp/MacroTokenSource.java b/src/java/org/anarres/cpp/MacroTokenSource.java index 264a1a6..53b0932 100644 --- a/src/java/org/anarres/cpp/MacroTokenSource.java +++ b/src/java/org/anarres/cpp/MacroTokenSource.java @@ -89,9 +89,11 @@ import static org.anarres.cpp.Token.*; private Token stringify(Token pos, Argument arg) { StringBuilder buf = new StringBuilder(); concat(buf, arg); + // System.out.println("Concat: " + arg + " -> " + buf); StringBuilder str = new StringBuilder("\""); escape(str, buf); - str.append('\"'); + str.append("\""); + // System.out.println("Escape: " + buf + " -> " + str); return new Token(STRING, pos.getLine(), pos.getColumn(), str.toString(), buf.toString()); @@ -118,6 +120,7 @@ import static org.anarres.cpp.Token.*; break; } Token tok = tokens.next(); + // System.out.println("Paste " + tok); switch (tok.getType()) { case M_PASTE: /* One extra to paste, plus one because the @@ -140,9 +143,12 @@ import static org.anarres.cpp.Token.*; } /* Push and re-lex. */ + /* StringBuilder src = new StringBuilder(); escape(src, buf); StringLexerSource sl = new StringLexerSource(src.toString()); + */ + StringLexerSource sl = new StringLexerSource(buf.toString()); /* XXX Check that concatenation produces a valid token. */ |