Aliasing to a Grammar Symbol without a Production Produces an AST without a Corresponding Node in node-types.json
I've run into this issue recently in tree-sitter-python in regards to the following commit: https://github.com/tree-sitter/tree-sitter-python/commit/3324e923485177d72c1a87d315f3b31bf2294585
Notice that alias($.expression, $.as_pattern_target) uses $.as_pattern_target, and $.as_pattern_target does not have a production. In node-types.json, as_pattern specifies as_pattern_target as an accepted type for its alias field, but as_pattern_target does not exist as a type in node-types.json.
Is this behavior intended?
Furthermore, this is also attempting to alias a grammar symbol which is specified as a supertype. Does it make sense to allow this?
Possibly related to #455
But still the case for the latest Tree-sitter version:
- https://github.com/tree-sitter/tree-sitter-python/blob/v0.23.0/grammar.js#L711
- https://github.com/tree-sitter/tree-sitter-python/blob/v0.23.0/src/node-types.json#L396
Just based on the node-types.json it is impossible to tell what as_pattern_target refers to.