Skip to content

Commit fd6cd4d

Browse files
committed
Revert "Fix for Issue #32: Line numbers incorrect in the compiler messages"
This reverts commit f4ae1f3.
1 parent f7096c7 commit fd6cd4d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/src/processing/app/preproc/PdePreprocessor.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ public String write() throws java.lang.Exception {
196196

197197
// Write the pde program to the cpp file
198198
protected void writeProgram(PrintStream out, String program, List<String> prototypes) {
199-
199+
int prototypeInsertionPoint = firstStatement(program);
200+
201+
out.print(program.substring(0, prototypeInsertionPoint));
200202
String arch = Base.getArch();
201203
if(arch == "msp430") out.print("#include \"Energia.h\"\n");
202204
else out.print("#include \"Arduino.h\"\n");
@@ -205,8 +207,8 @@ protected void writeProgram(PrintStream out, String program, List<String> protot
205207
for (int i = 0; i < prototypes.size(); i++) {
206208
out.print(prototypes.get(i) + "\n");
207209
}
208-
out.print("#line 1\n");
209-
out.print(program.substring(0));
210+
211+
out.print(program.substring(prototypeInsertionPoint));
210212
}
211213

212214

0 commit comments

Comments
 (0)