eraserhd / parinfer-rust

A Rust port of parinfer.
ISC License
546 stars 42 forks source link

Parens within enclosed symbol are not ignored in Scheme and Common Lisp #77

Closed mnacamura closed 4 years ago

mnacamura commented 4 years ago

In Scheme and Common Lisp, a pipe-enclosed literal is a symbol.

(let ((x '|(|))
  (print x))

In the above S-expression, ( inside |(| should be ignored, but parinfer-rust seems failing. I want a clue to fix this. Is it sufficient to add another switch for | around the code below? https://github.com/eraserhd/parinfer-rust/blob/bcfdcd147d576cdd7a597c4557768cf14a06dca4/src/parinfer.rs#L899-L900

eraserhd commented 4 years ago

Since Clojure doesn't have pipe-delimited symbols, it should be an option. But then, yes, handling pipe here and adding a flag like in_pipe_symbol to the state should do it.