Skip to content

Commit

Permalink
Support KTS parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
kunli2 committed Oct 30, 2023
1 parent b304082 commit cb3b734
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1056,12 +1056,13 @@ public J visitSafeQualifiedExpression(KtSafeQualifiedExpression expression, Exec

@Override
public J visitScript(KtScript script, ExecutionContext data) {
throw new UnsupportedOperationException("TODO");
return script.getBlockExpression().accept(this, data);
}

@Override
public J visitScriptInitializer(KtScriptInitializer initializer, ExecutionContext data) {
throw new UnsupportedOperationException("TODO");
J j = initializer.getBody().accept(this, data);
return j.withPrefix(merge(prefix(initializer), j.getPrefix()));
}

@Override
Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/openrewrite/kotlin/tree/KTSTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ void helloWorld() {
rewriteRun(
kotlinScript("""
import java.util.List
println("Hello, World!")
""")
);
Expand Down

0 comments on commit cb3b734

Please sign in to comment.