You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm reading up on macros. Just as last time I did so, I got confused about the difference between a node's "syntax kind" and "syntactic categories". Could the manual entry for "syntax kind" (which btw. simply points to the node constructor ATM instead of SyntaxNodeKind) have a sentence to distinguish the two? Could there be an additional sentence involving an example?
Additional context
From grepping around I think that "syntax kind" corresponds to the name of an AST data constructor in parsers that I'm used to, and "syntactic category" (the entry of which is crisp) is the open data type into which such a constructor injects. Not sure if that's a useful analogy, especially if you have never heard of abstract syntax trees.
The text was updated successfully, but these errors were encountered:
This is a great thing to add - thanks for pointing it out.
I think your understanding is correct here.
In traditional grammar lingo, a syntax category is a nonterminal and a syntax kind is essentially a named production. The correspondence isn't 100% but that's quite close.
What question should the reference manual answer?
I'm reading up on macros. Just as last time I did so, I got confused about the difference between a node's "syntax kind" and "syntactic categories". Could the manual entry for "syntax kind" (which btw. simply points to the
node
constructor ATM instead ofSyntaxNodeKind
) have a sentence to distinguish the two? Could there be an additional sentence involving an example?Additional context
From grepping around I think that "syntax kind" corresponds to the name of an AST data constructor in parsers that I'm used to, and "syntactic category" (the entry of which is crisp) is the open data type into which such a constructor injects. Not sure if that's a useful analogy, especially if you have never heard of abstract syntax trees.
The text was updated successfully, but these errors were encountered: