parinfer-lua icon indicating copy to clipboard operation
parinfer-lua copied to clipboard

Mishandling semicolon inside vertical bar literal

Open ylixir opened this issue 4 years ago • 4 comments

Parinfer thinks that semicolons between vertical bars is a comment (it's not). At least in common lisp, racket, and lumen this is wrong

(define |;| 5)
(print |;|)

is changed to

(define |;)| 5)
(print |;)|)

which is wrong.

reproductions: https://onecompiler.com/racket/3xjvghuay https://onecompiler.com/commonlisp/3xjvgwzbj

this is burning me when | is being used to quote literal code in a transpiler: https://github.com/sctb/lumen/blob/master/test.l#L202

ylixir avatar Nov 29 '21 16:11 ylixir

Thanks for reporting this! I am not familiar with CL, Racket, and Lumen.

This seems like something that should be handled "upstream" in the core parinfer.js implementation, and then can be fixed for parinfer-lua.

Out of curiosity, what are you using parinfer-lua for? :nerd_face:

oakmac avatar Dec 04 '21 11:12 oakmac

Out of curiosity, what are you using parinfer-lua for? 🤓

Not OP, but I am following the issue. I’m using parinfer-lua in a Neovim plugin. Thank you for your work on this!

gpanders avatar Dec 04 '21 14:12 gpanders

I'm using @gpanders plugin actually :-)

ylixir avatar Dec 04 '21 16:12 ylixir

This seems like something that should be handled "upstream" in the core parinfer.js implementation, and then can be fixed for parinfer-lua.

Did you mean to link your own fork? Should I open the ticket there? or upstream upsteam in the @shaunlebron repo?

edit: nvm, i see the original repo is unmaintained

ylixir avatar Dec 04 '21 16:12 ylixir