DefaultPackages icon indicating copy to clipboard operation
DefaultPackages copied to clipboard

lisp syntax highlighting treats ?\" as the start of a string.

Open alexflint opened this issue 9 years ago • 4 comments

The lisp syntax highlighting incorrectly treats ?\" as the start of a string, where in fact it is a character literal. This results in an inversion of string/non-string regions:

screenshot 2016-04-26 12 11 44

ST3, Build 3103, OSX 10.10

alexflint avatar Apr 26 '16 19:04 alexflint

I know effectively nothing about lisp, so I looked into this.

It seems #\ is common lisp and ?\ is emacs lisp? It seems the current syntax supports the former, but not that later. Is that correct?

wbond avatar Apr 26 '16 19:04 wbond

@wbond Yes that is correct. I should have mentioned that I'm working with elisp.

alexflint avatar Apr 26 '16 19:04 alexflint

Does syntax highlighting of lisp usually take into account both variants, or are there usually enough differences to cause problems?

wbond avatar Apr 26 '16 19:04 wbond

I'm actually not sure what other editors do, but there are relatively few syntactic differences between Common lisp / Elisp so it's probably possible to deal with them together. (Most of the differences are at the semantic level.)

alexflint avatar Apr 26 '16 19:04 alexflint