-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal: reorder ParsedNodeKind
for range checks
#907
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
ParsedNodeKind
for range checks, and added named sets tosupport querying parsed node kinds.
Details
Reorder
ParsedNodeKind
in 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
pnkDeclarativeDefs
andpnkRoutineDefs
similar toPNode
's kind,TNodeKind
.