Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Kotlin's statements and their frequent sugar #472

Open
wants to merge 20 commits into
base: develop/1.12.0
Choose a base branch
from

Conversation

sschr15
Copy link
Member

@sschr15 sschr15 commented Mar 23, 2025

This introduces large improvements to the structure of Kotlin decompilation. It gets rid of most (all?) incorrectly formatted labels, breaks, and continues, and it provides some support for when statements (those which compile to tableswitch and lookupswitch instructions).

This does make a couple small changes to the main Vineflower source.
It adds an additional getter in SwitchHeadExprent:

public List<List<Exprent>> getCaseValues() {
return caseValues;
}

It also makes a visibility change in ExprProcessor (private to public):
public static void addDeletedGotoInstructionMapping(Statement stat, TextBuffer buffer) {

All other changes are Kotlin-specific.

sschr15 added 20 commits March 22, 2025 19:36
…"do" statements

# Conflicts:
#	plugins/kotlin/src/main/java/org/vineflower/kotlin/stat/KDoStatement.java
#	plugins/kotlin/testData/results/pkg/TestForRange.dec
#	plugins/kotlin/testData/results/pkg/TestFunVarargs.dec
#	plugins/kotlin/testData/results/pkg/TestNonInlineLambda.dec
I should look into this more and see why it's seemingly quite inconsistent
This existed prior to the rebase, but something went amiss and I'm not quite sure what
This also fixes a potential issue where `repeat` would be generated despite counting down
Copy link

Test Results

   18 files  ±0     18 suites  ±0   1m 5s ⏱️ +3s
1 939 tests ±0  1 939 ✅ ±0  0 💤 ±0  0 ❌ ±0 
2 574 runs  ±0  2 574 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit ed32cd2. ± Comparison against base commit adf9083.

@sschr15 sschr15 mentioned this pull request Aug 23, 2024
36 tasks
@sschr15 sschr15 requested a review from jaskarth March 23, 2025 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant