nextjournal / clojure-mode

Clojure/Script mode for CodeMirror 6
https://nextjournal.github.io/clojure-mode/
Eclipse Public License 2.0
158 stars 18 forks source link

\s is not parsed as a Character #9

Closed kommen closed 2 years ago

kommen commented 3 years ago

To reproduce on https://nextjournal.github.io/clojure-mode/

Given this example code:

[\a] \s

Note that when copy and pasting a space is inserted between the \ and the s.

Slurping with ctrl + arrow right in this cursor position gives this results in invalid code.

[\a|] \s => [\a \] s

MrEbbinghaus commented 2 years ago

This is because of this line: https://github.com/lezer-parser/clojure/blob/172cf311376271a95986978e7041cb7dbd3fdd57/src/clojure.grammar#L113

From https://lezer.codemirror.net/docs/guide/#tokens :

there's no special meaning associated with . in this notation, or with escapes like \s

I am working on a fix.