You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having various operator token kinds is relevant during parsing, but they should potentially all be remapped to K"Identifier" afterward because their special status as operators is no longer meaningful once they live in the parse tree - they are essentially just identifiers which will be looked up with the usual scoping rules, just like any other identifier.
Code which processes syntax trees often has to do things like is_operator(x) || kind(x) == K"Identifier". Mapping them to identifiers simplifies things and fixes this issue. For the same reasons, I've also wished for this in JuliaLowering.jl.
One caveat is that this change might be unhelpful for the JuliaSyntax.tokenize() API - need to think about what to do there. (Perhaps operator kinds should be preserved in that case?)
Having various operator token kinds is relevant during parsing, but they should potentially all be remapped to
K"Identifier"
afterward because their special status as operators is no longer meaningful once they live in the parse tree - they are essentially just identifiers which will be looked up with the usual scoping rules, just like any other identifier.Code which processes syntax trees often has to do things like
is_operator(x) || kind(x) == K"Identifier"
. Mapping them to identifiers simplifies things and fixes this issue. For the same reasons, I've also wished for this in JuliaLowering.jl.One caveat is that this change might be unhelpful for the
JuliaSyntax.tokenize()
API - need to think about what to do there. (Perhaps operator kinds should be preserved in that case?)If we do this, we should also do it systematically. For example, to fix https://github.com/JuliaLang/JuliaSyntax.jl/pull/456/files#r1692517031
The text was updated successfully, but these errors were encountered: