@@ -194,9 +194,6 @@ private void parse(final String errorLog) {
194
194
// HACK scala code seems to always be pre-pended by some 10 lines of code(!?).
195
195
if ("Scala" .equals (lang .getLanguageName ()))
196
196
lineOffset += 10 ;
197
- // HACK and R by one (!?)
198
- else if ("R" .equals (lang .getLanguageName ()))
199
- lineOffset += 1 ;
200
197
201
198
errorLines = new TreeSet <>();
202
199
final StringTokenizer tokenizer = new StringTokenizer (errorLog , "\n " );
@@ -228,7 +225,6 @@ private void parseNonJava(final String lineText, final Collection<Integer> error
228
225
|| lineText .indexOf (".tools.nsc." ) > -1 // scala
229
226
|| lineText .indexOf ("at bsh." ) > -1 // beanshel
230
227
|| lineText .indexOf ("$Recompilation$" ) > -1 // javascript
231
- || lineText .indexOf ("at org.renjin." ) > -1 // R: The only thing useful in traces are Syntax errors!?
232
228
) {//
233
229
return ;
234
230
}
@@ -242,7 +238,7 @@ private void parseNonJava(final String lineText, final Collection<Integer> error
242
238
}
243
239
244
240
private void extractLineIndicesFromFilteredTextLines (final String lineText , final Collection <Integer > errorLines ) {
245
- // System.out.println(" Section being matched: " + lineText);
241
+ // System.out.println("Section being matched: " + lineText);
246
242
final Pattern pattern = Pattern .compile (":(\\ d+)|line\\ D*(\\ d+)" , Pattern .CASE_INSENSITIVE );
247
243
final Matcher matcher = pattern .matcher (lineText );
248
244
@@ -251,8 +247,8 @@ private void extractLineIndicesFromFilteredTextLines(final String lineText, fina
251
247
final String firstGroup = matcher .group (1 );
252
248
final String lastGroup = matcher .group (matcher .groupCount ());
253
249
final String group = (firstGroup == null ) ? lastGroup : firstGroup ;
254
- // System.out.println(" firstGroup: " + firstGroup);
255
- // System.out.println(" lastGroup: " + lastGroup);
250
+ // System.out.println("firstGroup: " + firstGroup);
251
+ // System.out.println("lastGroup: " + lastGroup);
256
252
257
253
final int lineNumber = Integer .valueOf (group .trim ());
258
254
if (lineNumber > 0 )
@@ -302,8 +298,7 @@ private void parseJava(final String filename, final String line, final Collectio
302
298
private void abort (final String msg , final boolean offsetNotice ) {
303
299
if (writer != null ) {
304
300
String finalMsg = "[WARNING] " + msg + "\n " ;
305
- if (offsetNotice )
306
- finalMsg += "[WARNING] Error line(s) below may not match line numbers in the editor\n " ;
301
+ finalMsg += "[WARNING] Error line(s) below may not match line numbers in the editor\n " ;
307
302
writer .textArea .insert (finalMsg , lengthOfJTextAreaWriter );
308
303
}
309
304
errorLines = null ;
@@ -380,15 +375,14 @@ public static void main(final String[] args) throws Exception {
380
375
final String python = "File \" New_.py\" , line 51, in <module>" ;
381
376
final String ruby = "<main> at Batch_Convert.rb:51" ;
382
377
final String scala = " at line number 51 at column number 18" ;
383
- final String beanshell = "or class name: Dummy : at Line: 51 : in file: " ;
378
+ final String beanshell = "or class name: Systesm : at Line: 51 : in file: " ;
384
379
final String javascript = " at jdk.nashorn.internal.scripts.Script$15$Greeting.:program(Greeting.js:51)" ;
385
- final String r = "org.renjin.parser.ParseException: Syntax error at line 51 char 2: syntax error, unexpected ',', expecting '\\ n' or ';'" ;
386
- Arrays .asList (groovy , python , ruby , scala , beanshell , javascript , r ).forEach (lang -> {
380
+ Arrays .asList (groovy , python , ruby , scala , beanshell , javascript ).forEach (lang -> {
387
381
final ErrorParser parser = new ErrorParser (new EditorPane ());
388
382
final TreeSet <Integer > errorLines = new TreeSet <>();
389
383
parser .extractLineIndicesFromFilteredTextLines (lang , errorLines );
390
384
assert (errorLines .first () == 50 );
391
- System .out .println ((errorLines .first () == 50 ) + ": " + lang );
385
+ System .out .println ((errorLines .first () == 50 ) + ": << " + lang + ">> " );
392
386
});
393
387
}
394
388
}
0 commit comments