Skip to content

Commit f927706

Browse files
committed
These #line directives help the compiler report errors with correct the filename and line number (issue 281 & 907)
From 1.0.3 source
1 parent dc2e909 commit f927706

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: app/src/processing/app/Sketch.java

+3
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,9 @@ public String preprocess(String buildPath, PdePreprocessor preprocessor) throws
13751375
for (SketchCode sc : code) {
13761376
if (sc.isExtension("ino") || sc.isExtension("pde")) {
13771377
sc.setPreprocOffset(bigCount);
1378+
// These #line directives help the compiler report errors with
1379+
// correct the filename and line number (issue 281 & 907)
1380+
bigCode.append("#line 1 \"" + sc.getFileName() + "\"\n");
13781381
bigCode.append(sc.getProgram());
13791382
bigCode.append('\n');
13801383
bigCount += sc.getLineCount();

0 commit comments

Comments
 (0)