Skip to content

feat(cst): add concrete syntax tree for auto-formatting - #30

Merged
onefloid merged 4 commits into
mainfrom
feat/cst
Aug 5, 2026
Merged

feat(cst): add concrete syntax tree for auto-formatting#30
onefloid merged 4 commits into
mainfrom
feat/cst

Conversation

@onefloid

@onefloid onefloid commented Aug 4, 2026

Copy link
Copy Markdown
Member

The parser now builds a lossless CST alongside the AST: every token, trivia included, falls inside exactly one node, so any subtree renders back to its exact source. Tokens carry an end offset to make that reconstruction exact for string literals.

On top of it:

  • F310 judges continuation lines as continuations instead of badly indented statements, and enforces a hanging indent (configurable via continuation_style). Block depth now comes from the CST, fixing the previously untested ELSE/ELSEIF levels.
  • F330 (new) flags lines over limit (120) and rewraps them at argument or operator boundaries, producing F310-conformant layout.
  • F250 and F220 no longer claim the indentation of a continuation line; F220/F240 no longer oscillate on nA = ;.
  • apply_fixes resolves overlapping fixes instead of silently dropping the wider one.

Assisted by: Claude Code

onefloid and others added 4 commits August 4, 2026 23:32
The parser now builds a lossless CST alongside the AST: every token,
trivia included, falls inside exactly one node, so any subtree renders
back to its exact source. Tokens carry an `end` offset to make that
reconstruction exact for string literals.

On top of it:

- F310 judges continuation lines as continuations instead of badly
  indented statements, and enforces a hanging indent (configurable via
  `continuation_style`). Block depth now comes from the CST, fixing the
  previously untested ELSE/ELSEIF levels.
- F330 (new) flags lines over `limit` (120) and rewraps them at argument
  or operator boundaries, producing F310-conformant layout.
- F250 and F220 no longer claim the indentation of a continuation line;
  F220/F240 no longer oscillate on `nA = ;`.
- apply_fixes resolves overlapping fixes instead of silently dropping the
  wider one.

Assisted by: Claude  Code
Fix YAML auto-fix so empty procedure sections like MetadataProcedure, DataProcedure, and EpilogProcedure no longer cause following properties to be removed.

Assisted-by: GitHub Copilot
@onefloid
onefloid merged commit 91eea56 into main Aug 5, 2026
2 checks passed
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