@Test public void should_count_statements_inside_blocks() throws Exception { String content = "fun foo() {" + "native[] { };" + "foo;" + "if (a) { foo; bar; };" + "class A{};" + "fun bar(){};" + "};" + "{ 2; 3; };"; assertThat(statements(content)).isEqualTo(7); }
public int statements(Tree tree) { statements = 0; scan(new TreeContext(), tree); return statements; }
StatementsVisitor extends TreeVisitor<TreeContext> { public int statements(Tree tree) { statements = 0; scan(new TreeContext(), tree); return statements; } }
StatementsVisitor extends TreeVisitor<TreeContext> { public int statements(Tree tree) { statements = 0; scan(new TreeContext(), tree); return statements; } StatementsVisitor(); }
StatementsVisitor extends TreeVisitor<TreeContext> { public int statements(Tree tree) { statements = 0; scan(new TreeContext(), tree); return statements; } StatementsVisitor(); int statements(Tree tree); }
StatementsVisitor extends TreeVisitor<TreeContext> { public int statements(Tree tree) { statements = 0; scan(new TreeContext(), tree); return statements; } StatementsVisitor(); int statements(Tree tree);  }