Don't store node names as a joined string #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "nodenames"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This stores the node names as an array of strings instead of a joined string. It is preparatory work for fixing https://github.com/lezer-parser/lezer/issues/35 (and depends on the corresponding change in
lezer.Hi, I'm not really that sure if I will ever do https://github.com/lezer-parser/lezer/issues/35 anymore (since it has a bunch of other tricky implications around interface complexity for parser packages). Also, I don't really see how this PR helps with that.
This doesn't help directly, but I have a future change that lets you export Typescript instead of Javascript, and then you can do:
This change is a precursor to that.
I think that would be worth doing even if it isn't integrated into the parser type, since user code still might want to do things like iterate over all of the node names, or use
NodeNamein their code.Iterating over node types can be done with
nodeSet.types. This string is purely internal and only intended fordeserialize.Right, but you can't get a static type of all the node names from
nodeSet.typesbecause they need to be written down as a const array in the source code in order for Typescript to understand them statically.Pull request closed