JuliaSyntax.jl
JuliaSyntax.jl copied to clipboard
Option to switch back to old Operator parsing
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:
- A way to keep the old behaviour via an argument to JuliaSyntax.parseall(...)
- 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 asIdentifier.
Ref https://github.com/JuliaLang/JuliaSyntax.jl/issues/545#issuecomment-2778397133 maybe? Adding a convenience function does seem like a good idea though.
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.