@@ -134,7 +134,7 @@ enum BuilderAction {
134
134
}
135
135
}
136
136
137
- private static final Pattern ERROR_FORMAT = Pattern .compile ("(.+\\ .\\ w+):(\\ d+)(:\\ d+)*:\\ s*(fatal)?\\ s*error:\\ s*(.*)\\ s*" , Pattern .MULTILINE | Pattern .DOTALL );
137
+ private static final Pattern ERROR_FORMAT = Pattern .compile ("(.+\\ .\\ w+):(\\ d+)(:\\ d+)*:\\ s*(( fatal)?\\ s*error:\\ s*) (.*)\\ s*" , Pattern .MULTILINE | Pattern .DOTALL );
138
138
139
139
private final File pathToSketch ;
140
140
private final Sketch sketch ;
@@ -516,16 +516,14 @@ public void message(String s) {
516
516
517
517
if (pieces != null ) {
518
518
String msg = "" ;
519
- int errorIdx = pieces .length - 1 ;
520
- String error = pieces [errorIdx ];
521
519
String filename = pieces [1 ];
522
520
int line = PApplet .parseInt (pieces [2 ]);
523
- int col ;
524
- if (errorIdx > 3 ) {
521
+ int col = - 1 ;
522
+ if (pieces [ 3 ] != null ) {
525
523
col = PApplet .parseInt (pieces [3 ].substring (1 ));
526
- } else {
527
- col = -1 ;
528
524
}
525
+ String errorPrefix = pieces [4 ];
526
+ String error = pieces [6 ];
529
527
530
528
if (error .trim ().equals ("SPI.h: No such file or directory" )) {
531
529
error = tr ("Please import the SPI library from the Sketch > Import Library menu." );
@@ -585,11 +583,8 @@ public void message(String s) {
585
583
String fileName = ex .getCodeFile ().getPrettyName ();
586
584
int lineNum = ex .getCodeLine () + 1 ;
587
585
int colNum = ex .getCodeColumn ();
588
- if (colNum != -1 ) {
589
- s = fileName + ":" + lineNum + ":" + colNum + ": error: " + error + msg ;
590
- } else {
591
- s = fileName + ":" + lineNum + ": error: " + error + msg ;
592
- }
586
+ String column = (colNum != -1 ) ? (":" + colNum ) : "" ;
587
+ s = fileName + ":" + lineNum + column + ": " + errorPrefix + error + msg ;
593
588
}
594
589
595
590
if (ex != null ) {
0 commit comments