code-d icon indicating copy to clipboard operation
code-d copied to clipboard

Syntax highlighter doesn’t understand comments in token strings

Open 0xEAB opened this issue 1 year ago • 1 comments

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
}

image

0xEAB avatar Dec 29 '24 02:12 0xEAB