Skip to content

Fix Expression Formatter#217

Open
rcosta358 wants to merge 2 commits intomainfrom
fix-expression-formatter
Open

Fix Expression Formatter#217
rcosta358 wants to merge 2 commits intomainfrom
fix-expression-formatter

Conversation

@rcosta358
Copy link
Copy Markdown
Collaborator

Description

This PR fixes the ExpressionFormatter so grouped expressions only have parentheses when needed for precedence or associativity. This simplifies expressions in the error messages and in the context debugger.

Example

Before and after:

  • (1)1
  • (a > 0)a > 0
  • a && (b > 0)a && b > 0

Unchanged cases:

  • a - (b + c)
  • x == (1 > 0)
  • !(x > 0)

Related Issue

None.

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Code refactoring

Checklist

  • Added/updated in ExpressionFormatterTest
  • mvn test passes locally
  • Updated docs/README if behavior or API changed

@rcosta358 rcosta358 requested a review from CatarinaGamboa May 10, 2026 13:40
@rcosta358 rcosta358 self-assigned this May 10, 2026
@rcosta358 rcosta358 added the error messages Related to error messages label May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

error messages Related to error messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant