@Test public void testFirstCpdToken() { TopLevelTree topLevel = (TopLevelTree) converter.parse("" + "@file:JvmName(\"xxx\")\n" + "package com.example\n" + "import com.example.MyClass\n" + "fun main(args: Array<String>) {}\n" + "class A {}"); assertThat(topLevel.declarations()).hasSize(5); assertThat(topLevel.firstCpdToken().text()).isEqualTo("fun"); }
@Override public Tree parse(String content) { KotlinTree kotlinTree = new KotlinTree(content); KotlinTreeVisitor kotlinTreeVisitor = new KotlinTreeVisitor(kotlinTree.psiFile, kotlinTree.metaDataProvider); return kotlinTreeVisitor.getSLangAST(); }
KotlinConverter implements ASTConverter { @Override public Tree parse(String content) { KotlinTree kotlinTree = new KotlinTree(content); KotlinTreeVisitor kotlinTreeVisitor = new KotlinTreeVisitor(kotlinTree.psiFile, kotlinTree.metaDataProvider); return kotlinTreeVisitor.getSLangAST(); } }
KotlinConverter implements ASTConverter { @Override public Tree parse(String content) { KotlinTree kotlinTree = new KotlinTree(content); KotlinTreeVisitor kotlinTreeVisitor = new KotlinTreeVisitor(kotlinTree.psiFile, kotlinTree.metaDataProvider); return kotlinTreeVisitor.getSLangAST(); }  }
KotlinConverter implements ASTConverter { @Override public Tree parse(String content) { KotlinTree kotlinTree = new KotlinTree(content); KotlinTreeVisitor kotlinTreeVisitor = new KotlinTreeVisitor(kotlinTree.psiFile, kotlinTree.metaDataProvider); return kotlinTreeVisitor.getSLangAST(); }  @Override Tree parse(String content); }
KotlinConverter implements ASTConverter { @Override public Tree parse(String content) { KotlinTree kotlinTree = new KotlinTree(content); KotlinTreeVisitor kotlinTreeVisitor = new KotlinTreeVisitor(kotlinTree.psiFile, kotlinTree.metaDataProvider); return kotlinTreeVisitor.getSLangAST(); }  @Override Tree parse(String content);  }