@Test public void tokens() { Tree tree = converter.parse("# line comment\n" + "if a == 1\n" + " a = \"ABC\"\n" + "end"); List<Token> tokens = tree.metaData().tokens(); assertThat(tokens).hasSize(8); assertThat(tokens).extracting(Token::text).containsExactly("if", "a", "==", "1", "a", "=", "ABC", "end"); assertThat(tokens).extracting(Token::type).containsExactly(KEYWORD, OTHER, OTHER, OTHER, OTHER, OTHER, STRING_LITERAL, KEYWORD); }
@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);  }