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

Fix Semi-colon on inline methods after property declaration disappears #585

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

kunli2
Copy link
Contributor

@kunli2 kunli2 commented Jan 3, 2024

fixes #560

An code example:

class Test {
    var n: Int = 0 /*C1*/ ;   protected set
}
  1. var n: Int = 0 /*C1*/ ; protected set is a K.Property.

  2. protected set is a setter accessor in the K.Property, it can be in a new line and then no semi-colon is required, but it can be in the same line and then a semi-colon is required as a delimiter.
    For the latter case with a semi-colon inside a K.Property, However, there is not a space room for /*C1*/ in K.Property.

This PR proposed to change variable declarations in K.Property from type J.VariableDeclarations to JRightPadded<J.VariableDeclarations>, plus SemiColon marker, then this case can be handled.

@knutwannheden knutwannheden merged commit 10052ef into main Jan 9, 2024
1 check passed
@knutwannheden knutwannheden deleted the 560 branch January 9, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Parsing issue: Semi-colon on inline methods after property declaration disappears
3 participants