Skip to content

compiler: handle grammar-sensitive suites and calls - #3192

Open
floitsch wants to merge 7 commits into
formatter/06-cli-gold-testsfrom
formatter/07-grammar-sensitive-suites
Open

compiler: handle grammar-sensitive suites and calls#3192
floitsch wants to merge 7 commits into
formatter/06-cli-gold-testsfrom
formatter/07-grammar-sensitive-suites

Conversation

@floitsch

@floitsch floitsch commented Aug 26, 2026

Copy link
Copy Markdown
Member

Part 7 of 10 in the AST-driven Toit pretty-printer stack. Depends on #3191.

Summary

  • format suite-bearing calls and declarations in conditions
  • preserve nested call argument structure
  • keep semantic separation around comments
  • parenthesize binary, conditional, nested-call, prefix-not, and grouped-suite arguments when required by Toit grammar
  • format suites in statement contexts
  • use leading broken binary operators, except trailing and/or

Verification

  • focused public-command gold cases cover blocks, lambdas, named suites, nested calls, condition declarations, and grammar-sensitive arguments
  • every formatted result is reparsed and checked for AST equivalence

Stack created with GitHub Stacks CLI

@floitsch floitsch changed the title formatter/07 grammar sensitive suites compiler: handle grammar-sensitive suites and calls Aug 26, 2026
@floitsch
floitsch force-pushed the formatter/07-grammar-sensitive-suites branch from 0fcaee2 to 9ded966 Compare August 30, 2026 11:08
@floitsch
floitsch force-pushed the formatter/07-grammar-sensitive-suites branch from 9ded966 to b63909b Compare August 30, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant