You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Treat a C# verbatim string as literal in the comment masker #462
strip_strings() treats a backslash as an escape inside every quoted span. In a C# verbatim string (@"...") the backslash is literal, so a verbatim string ending in one consumes its own closing quote, the masker never leaves the string, and the rest of the line is blanked:
LINE : var p = @"C:\tmp\"; // Two things. Here.
MASK : var p = @"
EXTR : []
The trailing comment is invisible to extracted_comments(), so every comment rule goes blind on that line.
Line-scoped.strip_strings() resets its quote state per line, so a broken line cannot corrupt the lines below it.
Warn-only today.comment-wrap and comment-case report without gating, and charset plus dupword are what gate, so nothing fails CI because of this.
C# only. No other fleet syntax has a verbatim-string form.
The related half
The verbatim escape for a quote is a doubled "", not \". The masker reads the first as closing and the second as reopening, so @"say ""hi"" now" is mis-paired even without a trailing backslash.
Fix sketch
Recognize the @" opener and mask to the next unpaired ", treating "" as a literal quote and the backslash as an ordinary character. The syntax table would need to say that C-like covers a language with verbatim strings, since the masker is currently language-agnostic within C_LIKE and .js, .ts, .json, and .jsonc share that entry while having no verbatim form.
Wanting a case in test_prose_lint.py covering @"C:\tmp\" with a trailing comment, watched failing first.
Found by Copilot in the low-confidence block of its review of promotion PR #460, and deferred there rather than expanding that promotion.
Both halves are covered: a verbatim string ending in a backslash keeps its closing quote, and a doubled quote is read as one escaped character rather than a close and a reopen. C# took its own syntax entry for it, since .c, .cpp, .js, .ts, .json, and .jsonc share the C-like markers but have no verbatim form.
Two further cases came out of the review of that PR and are fixed with it: the interpolated spellings @$" and $@" are both recognized, and verbatim rules are restricted to the double-quoted form so @'a''b' is read as an ordinary char literal.
Closing by hand rather than by keyword, since the fix landed on develop and Closes only fires on a merge into the default branch. It reaches main with promotion #460.
Activity
Scan every comment on a line, and read a verbatim string correctly (#464
ptr727 commentedon Jul 31, 2026
Fixed in #464, squashed to
developas 7bf8a12.Both halves are covered: a verbatim string ending in a backslash keeps its closing quote, and a doubled quote is read as one escaped character rather than a close and a reopen. C# took its own syntax entry for it, since
.c,.cpp,.js,.ts,.json, and.jsoncshare the C-like markers but have no verbatim form.Two further cases came out of the review of that PR and are fixed with it: the interpolated spellings
@$"and$@"are both recognized, and verbatim rules are restricted to the double-quoted form so@'a''b'is read as an ordinary char literal.Closing by hand rather than by keyword, since the fix landed on
developandClosesonly fires on a merge into the default branch. It reachesmainwith promotion #460.Promote the tiered charset rule and the comment gate to main (#460)
Record three mechanics the promotion loop had to learn twice (#468)
Remove two rules this repository already had (#472)
Promote the promotion-loop mechanics to main (#469)