parinfer / parinfer.js

Let's simplify the way we write Lisp
https://shaunlebron.github.io/parinfer
MIT License
1.76k stars 40 forks source link

Weird edge cases around #| (Common Lisp) #212

Closed gilch closed 1 month ago

gilch commented 2 months ago

Tested with the Spacemacs layer, so reported here: https://github.com/justinbarclay/parinfer-rust-emacs/issues/15

I'm not sure how far upstream the problem goes, but the trailing brackets don't get added as expected.

Here, a single quoted symbol doesn't seem to be tokenizing properly:

(defun foo (
  2

'foo#|bar|

I checked the spec. That's a symbol, not a symbol followed by a start comment reader macro, and should tokenize as such.

# can't start a symbol, but it is allowed inside symbols (non-terminating macro character), and |s are allowed as long as there's an even number (\| doesn't count). (| is the standard multiple escape character.)

shaunlebron commented 1 month ago

Thanks. I couldn’t reproduce it in the demo editor, so it’s downstream: https://shaunlebron.github.io/parinfer/demo

gilch commented 1 month ago

Confirmed not in the demo editor. If that's configured for Clojure, I wouldn't expect it to show up though. Is there a Common Lisp configuration/mode we could try, or does that only exist downstream?