Emacs-D-Mode-Maintainers / Emacs-D-Mode

An Emacs mode for D code.
GNU General Public License v3.0
84 stars 21 forks source link

Occasional incorrect fontification of string literals due to escapes #49

Closed nordlow closed 6 years ago

nordlow commented 9 years ago

Fontification of string literals, for instance, in module std.net.isemail.d at line 907 on (git master) fails for me.

The line contains

    assert("\"test\\\u0000\"@iana.org".isEmail(CheckDns.no, EmailStatusCode.any).statusCode ==
        EmailStatusCode.deprecatedQuotedPair);

Another failure starts at line 1699

        backslash = `\`,
        dot = ".",
        doubleQuote = `"`,
```.
dmakarov commented 9 years ago

It's not a work-around, but an observation -- if you delete the line 907 and then undo the delete, the line is fontified correctly after that. The same for the other incorrectly fontified lines in the file. Emacs is generally very slow when it fontifies the buffer with this file. So it looks like an issue with some inefficiency caused by d-mode.

MartinNowak commented 6 years ago

Here is a reproducer, seems like the \`` handling is countering the\"` handling.

`beg`
"\"bugbugbug"
`end`