Term numbers in a mixed language may overlap

If I combine two languages (via parseMixed) and walk the resulting tree, it is unclear which grammar/term file syntaxNode.type.id corresponds to. Is there a way to manually offset the term indexes so they don’t collide?

I’m using the CLI and don’t see anything in the flags. It isn’t obvious to me if the @lezer/generator module supports this somewhere.

No, this isn’t supported. Each node set is its own independent thing. Don’t dispatch blindly on the node ids. Verify the identity of the node type or use node props.

1 Like