nim-lang / nim-mode

An emacs major mode for the Nim programming language
138 stars 46 forks source link

add test, remove "" skip, fix #210 #211

Closed krux02 closed 6 years ago

krux02 commented 6 years ago

I would like to point out, that a raw string is not just an r before the string literal, it can be any identifier before a string literal.

My fix isn't 100% correct. It treats r" abc""def " like two different literals, but for syntax highlighting, that doesn't matter at all.

yuutayamada commented 6 years ago

It matters. As far as I remember it's for evil (vi emulation) command like di" (delete inside ""). It works based on emacs' syntax class (https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.html)

krux02 commented 6 years ago

I guess you have to make a decision here:

Either:

Or:

Of course you can also provide a better solution.

yuutayamada commented 6 years ago

Have a corner case where half of a file from the compiler isn't highlighted at all (more than 300 lines), and of course vi commands such as di" won't work properly either.

I think I can fix for the raw string literal

yuutayamada commented 6 years ago

closing this PR because #210 was fixed