diff options
Diffstat (limited to 'src/main/java/org/anarres/cpp/MacroTokenSource.java')
-rw-r--r-- | src/main/java/org/anarres/cpp/MacroTokenSource.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/anarres/cpp/MacroTokenSource.java b/src/main/java/org/anarres/cpp/MacroTokenSource.java index 5874584..07c388c 100644 --- a/src/main/java/org/anarres/cpp/MacroTokenSource.java +++ b/src/main/java/org/anarres/cpp/MacroTokenSource.java @@ -78,9 +78,13 @@ import static org.anarres.cpp.Token.*; private void concat(StringBuilder buf, Argument arg) { Iterator<Token> it = arg.iterator(); + boolean newline = false; while (it.hasNext()) { Token tok = it.next(); - buf.append(tok.getText()); + String text = tok.getText(); + if (text.contains("\n")) newline = true; + if (newline) text = text.trim(); + buf.append(text); } } |