JuliaSyntax.jl icon indicating copy to clipboard operation
JuliaSyntax.jl copied to clipboard

Option to switch back to old Operator parsing

Open domluna opened this issue 7 months ago • 1 comments

v1 parses all operators as Identifier now. JuliaFormatter relied on JuliaSyntax.is_operator(node) since it treats operators different than identifiers, mainly for spacing around calls.

I'm wondering there is either:

  1. A way to keep the old behaviour via an argument to JuliaSyntax.parseall(...)
  2. Some function that I can use such as JuliaSyntax.is_operator(node) (currently doesn't work) to verify it's an operator even though they are now parsed as Identifier.

domluna avatar Apr 27 '25 16:04 domluna

Ref https://github.com/JuliaLang/JuliaSyntax.jl/issues/545#issuecomment-2778397133 maybe? Adding a convenience function does seem like a good idea though.

pfitzseb avatar Apr 28 '25 17:04 pfitzseb

I'm gonna go with no - you can always re-lex the identifier to figure out if it's a valid operator (or ask Base.isoperator), but you may be looking for the infix flag instead.

Keno avatar Jul 11 '25 06:07 Keno