@Test public void testAsString() throws Exception { Tree tree = p.parse("[, a, , ]"); assertThat(CheckUtils.asString(tree)).isEqualTo("[, a, , ]"); }
public static String asString(Tree tree) { if (tree.is(Kind.TOKEN)) { return ((SyntaxToken) tree).text(); } else { StringBuilder sb = new StringBuilder(); Iterator<Tree> treeIterator = ((JavaScriptTree) tree).childrenIterator(); SyntaxToken prevToken = null; while (treeIterator.hasNext()) { Tree child = treeIterator.next(); if (child != null) { appendChild(sb, prevToken, child); prevToken = child.lastToken(); } } return sb.toString(); } }
CheckUtils { public static String asString(Tree tree) { if (tree.is(Kind.TOKEN)) { return ((SyntaxToken) tree).text(); } else { StringBuilder sb = new StringBuilder(); Iterator<Tree> treeIterator = ((JavaScriptTree) tree).childrenIterator(); SyntaxToken prevToken = null; while (treeIterator.hasNext()) { Tree child = treeIterator.next(); if (child != null) { appendChild(sb, prevToken, child); prevToken = child.lastToken(); } } return sb.toString(); } } }
CheckUtils { public static String asString(Tree tree) { if (tree.is(Kind.TOKEN)) { return ((SyntaxToken) tree).text(); } else { StringBuilder sb = new StringBuilder(); Iterator<Tree> treeIterator = ((JavaScriptTree) tree).childrenIterator(); SyntaxToken prevToken = null; while (treeIterator.hasNext()) { Tree child = treeIterator.next(); if (child != null) { appendChild(sb, prevToken, child); prevToken = child.lastToken(); } } return sb.toString(); } } private  CheckUtils(); }
CheckUtils { public static String asString(Tree tree) { if (tree.is(Kind.TOKEN)) { return ((SyntaxToken) tree).text(); } else { StringBuilder sb = new StringBuilder(); Iterator<Tree> treeIterator = ((JavaScriptTree) tree).childrenIterator(); SyntaxToken prevToken = null; while (treeIterator.hasNext()) { Tree child = treeIterator.next(); if (child != null) { appendChild(sb, prevToken, child); prevToken = child.lastToken(); } } return sb.toString(); } } private  CheckUtils(); static String asString(Tree tree); static ExpressionTree removeParenthesis(ExpressionTree expressionTree); static Tree parentIgnoreParentheses(Tree tree); static ControlFlowGraph buildControlFlowGraph(Tree tree); static boolean isDescendant(Tree tree, Tree potentialParent); @Nullable static Tree getFirstAncestor(Tree tree, Kinds... kind); static List<String> readLines(JavaScriptFile file); }
CheckUtils { public static String asString(Tree tree) { if (tree.is(Kind.TOKEN)) { return ((SyntaxToken) tree).text(); } else { StringBuilder sb = new StringBuilder(); Iterator<Tree> treeIterator = ((JavaScriptTree) tree).childrenIterator(); SyntaxToken prevToken = null; while (treeIterator.hasNext()) { Tree child = treeIterator.next(); if (child != null) { appendChild(sb, prevToken, child); prevToken = child.lastToken(); } } return sb.toString(); } } private  CheckUtils(); static String asString(Tree tree); static ExpressionTree removeParenthesis(ExpressionTree expressionTree); static Tree parentIgnoreParentheses(Tree tree); static ControlFlowGraph buildControlFlowGraph(Tree tree); static boolean isDescendant(Tree tree, Tree potentialParent); @Nullable static Tree getFirstAncestor(Tree tree, Kinds... kind); static List<String> readLines(JavaScriptFile file);  }