Skip to content

comp.ts: shed tokens with no output change - #1922

Merged
Lorenzobattistela merged 1 commit into
mainfrom
comp-shed-tokens
Oct 29, 2026
Merged

Lorenzobattistela merged 1 commit into
mainfrom
comp-shed-tokens

Conversation

@nicolas-abril

@nicolas-abril nicolas-abril commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Trims bend2/comp.ts from 65,976 to 65,860 ttok (cap 66,000) with no change to what the compiler emits.

What

  • file_push(sc, ...lines) is variadic (each line still indented by the segment's tab); consecutive calls are collapsed only where evaluating the arguments first can't reorder emitted lines.
  • Single-use locals inlined, optional tld?: Bend.TLD parameters, lines rejoined where they fit in 80 columns.
  • Tighter comments; the ty_holds comment is reworded.

Main's type declarations, helpers (name_clean, FL.book.*, the OPERATIONS literals, the #include lines) and explicit checks (=== 0, > 0, === null, if/else) are kept as they are; an earlier revision of this PR shortened them and that was undone after review.

Verified

  • compile_book (C) and js_book (JS) hashed for every .bend under tests/, bench/ and demos/ on main (65a521f) and on this branch: 1,881 lanes over 1,866 files, 0 differences; files that fail to compile on main fail with the same error here.
  • Gates: repo 54/54, test 1781/1781, ping 80/81, perf 124/124 (all PASS).
  • comp.ts type-checks with only main's existing errors.

🤖 Generated with Claude Code

A variadic file_push, inlined single-use locals, optional tld parameters,
lines rejoined where they fit in 80 columns and tighter comments. Main's
types, helpers and explicit checks are kept. Rebased onto main as one
commit (the earlier commits undid part of the first).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

2 participants