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

Router: merge classic select chain rule with other #2067

Merged
merged 3 commits into from
Jul 5, 2020

Conversation

kitbellew
Copy link
Collaborator

@kitbellew kitbellew commented Jul 4, 2020

This will apply the same clean indentation logic as for newlines.source != classic.

Requires adding support for multiple activation tags within a split; one was used to apply indent to the first break only, and the new one will be used to reduce cost of a split down the chain after the first break and remove the newline penalization policy consistent with the previous rule; this filtering capability was introduced in #2060.

Fixes #1334. Supersedes #1557.

@@ -38,8 +38,8 @@ case class OptimalToken(token: Token, killOnFail: Boolean = false) {
case class Split(
modExt: ModExt,
cost: Int,
tag: SplitTag = SplitTag.Active,
activeTag: SplitTag = SplitTag.Active,
neededTags: Long = SplitTag.Active.mask,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how much better the bit mask is than just Set[SplitTag] here and contains instead of (neededTags & splitTag.mask) != 0

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. i thought i had seen a performance difference earlier but couldn't prove it now.

kitbellew added 3 commits July 5, 2020 03:25
Also, a few more correct tests, to ensure functionality is preserved.
Remove Active and Ignored explicit tags as no longer needed.
@kitbellew kitbellew merged commit eb36882 into scalameta:master Jul 5, 2020
@kitbellew kitbellew deleted the 2067 branch July 5, 2020 12:51
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.

Wired alignment when chain contains comment / no parenthesis call / with parenthesis call
2 participants