diff options
-rw-r--r-- | src/main/java/org/anarres/cpp/MacroTokenSource.java | 6 | ||||
-rw-r--r-- | src/main/java/org/anarres/cpp/Preprocessor.java | 1 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/org/anarres/cpp/MacroTokenSource.java b/src/main/java/org/anarres/cpp/MacroTokenSource.java index 07c388c..5874584 100644 --- a/src/main/java/org/anarres/cpp/MacroTokenSource.java +++ b/src/main/java/org/anarres/cpp/MacroTokenSource.java @@ -78,13 +78,9 @@ 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(); - String text = tok.getText(); - if (text.contains("\n")) newline = true; - if (newline) text = text.trim(); - buf.append(text); + buf.append(tok.getText()); } } diff --git a/src/main/java/org/anarres/cpp/Preprocessor.java b/src/main/java/org/anarres/cpp/Preprocessor.java index af3b896..155117e 100644 --- a/src/main/java/org/anarres/cpp/Preprocessor.java +++ b/src/main/java/org/anarres/cpp/Preprocessor.java @@ -763,6 +763,7 @@ public class Preprocessor implements Closeable { case WHITESPACE: case CCOMMENT: case CPPCOMMENT: + case NL: /* Avoid duplicating spaces. */ space = true; break; |