@Test public void ranges() { Tree topLevelTree = converter.parse("2; abc; 4\n2431323"); assertTree(topLevelTree).hasTextRange(1, 0, 2, 7); Tree nativeAllInstructionsTree = topLevelTree.children().get(0); assertTree(nativeAllInstructionsTree.children().get(0)).hasTextRange(1, 0, 1, 1); assertTree(nativeAllInstructionsTree.children().get(1)).hasTextRange(1, 3, 1, 6); topLevelTree = converter.parse("#start comment\n" + "require 'stuff'\n" + "a = 2 && 1\n" + "def method()\n" + " a += 2 # line comment\n" + "end\n" + "result = obj.methodcall(argument) ; result"); nativeAllInstructionsTree = topLevelTree.children().get(0); assertTree(topLevelTree).hasTextRange(1, 0, 7, 42); assertTree(nativeAllInstructionsTree.children().get(0)).hasTextRange(2, 0, 2, 15); topLevelTree = converter.parse("# only comment file\n# comment line 2"); assertTree(topLevelTree).hasTextRange(1, 0, 2, 16); }
@Override public Tree parse(String content) { try { return parseContent(content); } catch (StandardError e) { throw new ParseException(e.getMessage(), getErrorLocation(e), e); } catch (Exception e) { throw new ParseException(e.getMessage(), null, e); } }
RubyConverter implements ASTConverter { @Override public Tree parse(String content) { try { return parseContent(content); } catch (StandardError e) { throw new ParseException(e.getMessage(), getErrorLocation(e), e); } catch (Exception e) { throw new ParseException(e.getMessage(), null, e); } } }
RubyConverter implements ASTConverter { @Override public Tree parse(String content) { try { return parseContent(content); } catch (StandardError e) { throw new ParseException(e.getMessage(), getErrorLocation(e), e); } catch (Exception e) { throw new ParseException(e.getMessage(), null, e); } } RubyConverter(RubyRuntimeAdapter rubyRuntimeAdapter);  RubyConverter(); }
RubyConverter implements ASTConverter { @Override public Tree parse(String content) { try { return parseContent(content); } catch (StandardError e) { throw new ParseException(e.getMessage(), getErrorLocation(e), e); } catch (Exception e) { throw new ParseException(e.getMessage(), null, e); } } RubyConverter(RubyRuntimeAdapter rubyRuntimeAdapter);  RubyConverter(); @Override void terminate(); @Override Tree parse(String content); }
RubyConverter implements ASTConverter { @Override public Tree parse(String content) { try { return parseContent(content); } catch (StandardError e) { throw new ParseException(e.getMessage(), getErrorLocation(e), e); } catch (Exception e) { throw new ParseException(e.getMessage(), null, e); } } RubyConverter(RubyRuntimeAdapter rubyRuntimeAdapter);  RubyConverter(); @Override void terminate(); @Override Tree parse(String content);  }