C: fix generation of '#line' directive
@@ -182,11 +182,10 @@ public class BufferedCodeWriter extends CodeWriter {
fileName = initialFileName;
lineNumber = absLineNumber;
}
- if (!Objects.equals(this.fileName, fileName) || this.lineNumber != lineNumber) {
if (isNewLine) {
pendingFileName = fileName;
pendingLineNumber = lineNumber;
- } else {
+ } else if (!Objects.equals(this.fileName, fileName) || this.lineNumber != lineNumber) {
this.lineNumber++;
absLineNumber++;
writer.println();
@@ -195,7 +194,6 @@ public class BufferedCodeWriter extends CodeWriter {
}
}
}
- }
static abstract class Fragment {
abstract void writeTo(WriterWithContext writer);
