Closed conartist6 closed 2 years ago
The ECMAScript specification uses the term "input element" (and note that tokens are a strict subset of input elements, with line terminators, linear whitespace, and comments being included in the latter category but not the former). In https://github.com/estree/estree/issues/41#issuecomment-131636382 , I used sourceElements
as the closest synonym I could find that didn't read strangely when removed from the context of that specification.
I'm leaning towards node.cstTokens
. If I can't use a name directly from the spec I don't think cstTokens
has an appreciably different meaning than sourceElements
.
We need to carefully consider the best way to attach tokens to nodes.
node.tokens
property has existing usages which would cause conflicts and breakages.node[Symbol.for('cst/tokens')]
would make the data format less usable -- harder to inspect, serialize, deserialize, etc.node.cstTokens
ornode.ownTokens
seems like it would probably be best.