@@ -194,9 +194,6 @@ private void parse(final String errorLog) {
194194 // HACK scala code seems to always be pre-pended by some 10 lines of code(!?).
195195 if ("Scala" .equals (lang .getLanguageName ()))
196196 lineOffset += 10 ;
197- // HACK and R by one (!?)
198- else if ("R" .equals (lang .getLanguageName ()))
199- lineOffset += 1 ;
200197
201198 errorLines = new TreeSet <>();
202199 final StringTokenizer tokenizer = new StringTokenizer (errorLog , "\n " );
@@ -228,7 +225,6 @@ private void parseNonJava(final String lineText, final Collection<Integer> error
228225 || lineText .indexOf (".tools.nsc." ) > -1 // scala
229226 || lineText .indexOf ("at bsh." ) > -1 // beanshel
230227 || lineText .indexOf ("$Recompilation$" ) > -1 // javascript
231- || lineText .indexOf ("at org.renjin." ) > -1 // R: The only thing useful in traces are Syntax errors!?
232228 ) {//
233229 return ;
234230 }
@@ -242,7 +238,7 @@ private void parseNonJava(final String lineText, final Collection<Integer> error
242238 }
243239
244240 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);
246242 final Pattern pattern = Pattern .compile (":(\\ d+)|line\\ D*(\\ d+)" , Pattern .CASE_INSENSITIVE );
247243 final Matcher matcher = pattern .matcher (lineText );
248244
@@ -251,8 +247,8 @@ private void extractLineIndicesFromFilteredTextLines(final String lineText, fina
251247 final String firstGroup = matcher .group (1 );
252248 final String lastGroup = matcher .group (matcher .groupCount ());
253249 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);
256252
257253 final int lineNumber = Integer .valueOf (group .trim ());
258254 if (lineNumber > 0 )
@@ -302,8 +298,7 @@ private void parseJava(final String filename, final String line, final Collectio
302298 private void abort (final String msg , final boolean offsetNotice ) {
303299 if (writer != null ) {
304300 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 " ;
307302 writer .textArea .insert (finalMsg , lengthOfJTextAreaWriter );
308303 }
309304 errorLines = null ;
@@ -380,15 +375,14 @@ public static void main(final String[] args) throws Exception {
380375 final String python = "File \" New_.py\" , line 51, in <module>" ;
381376 final String ruby = "<main> at Batch_Convert.rb:51" ;
382377 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: " ;
384379 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 -> {
387381 final ErrorParser parser = new ErrorParser (new EditorPane ());
388382 final TreeSet <Integer > errorLines = new TreeSet <>();
389383 parser .extractLineIndicesFromFilteredTextLines (lang , errorLines );
390384 assert (errorLines .first () == 50 );
391- System .out .println ((errorLines .first () == 50 ) + ": " + lang );
385+ System .out .println ((errorLines .first () == 50 ) + ": << " + lang + ">> " );
392386 });
393387 }
394388}
0 commit comments