8000 Preserve equal-precedence binary grouping in AST replacements by dajiaohuang · Pull Request #1829 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

Preserve equal-precedence binary grouping in AST replacements - #1829

Closed
dajiaohuang wants to merge 1 commit into
dominikh:masterfrom
dajiaohuang:fix/astutil-parenthesize-equal-precedence
Closed

dajiaohuang wants to merge 1 commit into
dominikh:masterfrom
dajiaohuang:fix/astutil-parenthesize-equal-precedence

Conversation

@dajiaohuang
Copy link
Copy Markdown

When replacing a binary expression's right operand with another binary expression at the same precedence, the generated expression needs parentheses to preserve its grouping. Add this case to MaybeParenthesize. Static review and git diff --check completed; tests were not run per coordinator direction.

@dajiaohuang dajiaohuang closed this Oct 8, 2026
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

0