Skip to content

fix(effects): respect C and JS line continuations - #1606

Closed
oxura wants to merge 1 commit into
bendlang:mainfrom
oxura:fix/foreign-comment-newlines-20261016
Closed

oxura wants to merge 1 commit into
bendlang:mainfrom
oxura:fix/foreign-comment-newlines-20261016

Conversation

@oxura

@oxura oxura commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Fixes #1604.

A backslash at the end of a JS comment hid the next line from ID expansion. C had the reverse problem with CRLF continuations. Splicing C lines before scanning fixes both, including a CID token split across physical C lines.

The regression returns a real Some{42} from each foreign backend. It fails before the patch (unexpanded JS CID; undeclared C CID/Some) and prints 42 after it. I also ran the existing comment regression on Bun and native C, and the CRLF C reproducer as a native binary. Repository gate: 54/54 on this branch.

I left this draft because main is already over its permanent compiler cap: 234cb9b has 64,092 ttok. This branch is based on 7e120d5 and adds 18 tokens (63,618 → 63,636); no cap changes or comment trimming. It needs rebasing once main has room.

Linux x86-64, Bun 1.4.3, clang 22.1.8. I have not run the mini-cluster/Metal/CUDA gates. AI-assisted patch.

@Lorenzobattistela

Copy link
Copy Markdown
Collaborator

Closing as a duplicate of #1653, which takes the same approach for #1604 and now includes this PR's C cases (CRLF continuation, CID split across lines) in its test. Thanks for the report and the reproducers.

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.

Foreign effect ID scanning uses the wrong line-continuation rules

2 participants