code-d
code-d copied to clipboard
Syntax highlighter doesn’t understand comments in token strings
Apparently, the syntax highlighter thinks that this innocent single-quote apostrophe in the comment within the token string would open a character literal.
import std.stdio;
void main() {
// comment (green)
writeln(q{
// When this function gets called, the this pointer isn't
});
// comment; highlighter thinks this is a character literal
// oh' well
}
Real-world occurrence: https://github.com/dlang/phobos/blob/v2.109.1/std/functional.d#L1666