internal: reorder ParsedNodeKind for range checks - #907
Conversation
saem
left a comment
There was a problem hiding this comment.
I'm trying to understand the reasoning for the movement, or put another way, what are the group principles being applied to come up with the new ordering.
the type section I can sort of understand (guessing), but I'm struggling to come up with the reasons for the const def move, especially when taking ident def into account. The important part isn't whether identdef should move or not, but what are the rules/principles we should be following so we can make sure things are consistent.
Co-authored-by: Saem Ghani <saemghani+github@gmail.com>
saem
left a comment
There was a problem hiding this comment.
Generally speaking, I'm not a huge fan of reordering the enum based on the needs of a consumer, the order needs to be producer centric as the primary need is parsing.
Creating these seemingly convenient consumer/read side ranges end up quietly coupling the producer and consumer(s). Which results in refactorings to a a small collection of parser modules spilling out to changes in various consumer locations.
Consumers are better off using provided or created named sets for their querying need. I'm ok with this change going through because it doesn't trouble the parser yet, but this is something to be mindful of going forward.
|
Updating the PR title and body. If I have further questions, i'll ping @bung87 in chat. |
ParsedNodeKind for range checks
|
/merge |
Summary
Reorder
ParsedNodeKindfor range checks, and added named sets tosupport querying parsed node kinds.
Details
Reorder
ParsedNodeKindin order to support ranges over similar kinds.This is considered experimental as the motivation for the reodering came
from usage in
suggest(a consumer). The ordering should be determinedby the
parser(the producer). Creating these seemingly convenientconsumer/read side ranges end up quietly coupling the producer and
consumer(s). Which results in refactorings to a small collection of
parser modules spilling out to changes in various consumer locations. In
this case these might coincide with the parser's needs, as well.
Additionally, added
pnkDeclarativeDefsandpnkRoutineDefssimilar toPNode's kind,TNodeKind.