Skip to content

fix(rust): read byte and C raw strings as raw in the input scan - #228

Merged
adityankale190895 merged 3 commits into
DiffCI:mainfrom
FredApps:rust/lexer-prefixed-raw-strings
Nov 18, 2026
Merged

adityankale190895 merged 3 commits into
DiffCI:mainfrom
FredApps:rust/lexer-prefixed-raw-strings

Conversation

@FredApps

Copy link
Copy Markdown
Contributor

Fixes #220

The input scan now reads br"…", cr"…", br#"…"# and cr#"…"# as raw strings, the same way it already reads r"…". Before, a backslash inside one (br"\") escaped the closing quote, so a computed include! or a #[path] on the next lines went unseen and the crate didn't fall back.

It's a one-line change to the raw-string regex in rustInputs, plus a test that hides both an include!(concat!(…)) and a #[path] behind each prefix. It also checks that a quote inside a hashed byte raw string doesn't start a string.

Validation (Linux, Node 22, Cargo 1.100): npm run typecheck and the Rust test files (tests/repo/rust-*.test.ts, tests/planner/rust-command.test.ts) pass. The new test fails on main and passes here.

Unsupported, as before: computed includes and #[path] still fall back. This only makes sure they're seen.

@FredApps
FredApps marked this pull request as ready for review November 17, 2026 17:18
@FredApps
FredApps marked this pull request as draft November 17, 2026 17:19
@FredApps
FredApps marked this pull request as ready for review November 17, 2026 17:41
I, FredApps <[email protected]>, hereby add my Signed-off-by to this commit: 9d856e5
I, FredApps <[email protected]>, hereby add my Signed-off-by to this commit: bec630f

Signed-off-by: FredApps <[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.

Rust adapter: byte and C raw strings (br"\", cr"\") hide includes and #[path] from the input scan

2 participants