You can’t configure a parser’s set of node types to add per-node props, obviously, since the parser has a node types, not a set of individual nodes. How are you planning to add these? There’s no way to add custom per-node props in a Lezer-generated LR parser. They do use those for a few things (like context hashes and lookahead distances) internally, but to do something like resolve references at parse time and store them in the tree, you’d have to create a custom parser.
Ah got it. I’m trying to reimplement the parser that hyperformula uses (internally it built on chevrotain), and was looking something similar in code to
where for some cell tokens, you’re able to define a javascript function to add metadata to individual AST nodes based on the AST type.
The metadata is useful because for some interactions, like turning A2 into A$2, it’s easier to operate on