Skip to content

fix(lexers): keep escaped quotes inside CMake arguments - #1519

Merged
github-actions[bot] merged 1 commit into
alecthomas:masterfrom
yxshee:fix/cmake-escaped-quotes
Nov 19, 2026
Merged

github-actions[bot] merged 1 commit into
alecthomas:masterfrom
yxshee:fix/cmake-escaped-quotes

Conversation

@yxshee

@yxshee yxshee commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

An escaped quote closes a CMake string prematurely in Chroma. CMake prints both messages in this example. Chroma treats everything from the hash to the end of the first line as a comment, so the following command name goes unrecognized.

message("before \"# still quoted\" after")
message("next")

Any backslash and the character following it are now consumed together within quotes, so only an unescaped quote will end a quoted string.

All 314 quoted arguments sampled from CMake's installed modules are preserved. The regression test fails against master. bit test, bit lint and bit check-generated all succeed.

@github-actions
github-actions Bot enabled auto-merge (squash) November 19, 2026 12:51
@github-actions
github-actions Bot merged commit 33512c7 into alecthomas:master Nov 19, 2026
4 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