-
Notifications
You must be signed in to change notification settings - Fork 85
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
misc: store context as property on ParsingState #3997
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3997 +/- ##
=======================================
Coverage 90.16% 90.16%
=======================================
Files 458 458
Lines 58291 58298 +7
Branches 5691 5691
=======================================
+ Hits 52559 52566 +7
Misses 4340 4340
Partials 1392 1392 ☔ View full report in Codecov by Sentry. |
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 unsure if this change is sound with InferenceContext
being mutable. If it's only something we use internally then it's probably fine
Aren't they both just as mutable as each other? |
True, I for some reason thought we were copying it when making the context but we obviously weren't |
Could you remind me of the reason for the |
That's the next PR! |
I'm actually going towards using the ConstraintContext for inference again. |
@@ -51,7 +50,7 @@ class ParsingState: | |||
successors: list[Successor | None | Sequence[Successor]] | |||
attributes: dict[str, Attribute] | |||
properties: dict[str, Attribute] | |||
variables: dict[str, ConstraintVariableType] | |||
context: InferenceContext |
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 feel context
is a slightly ambiguous name but I'm getting the feeling that this is part of a bigger change that may make it make more sense
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.
Yeah it's InferenceContext in this PR but will be a ConstraintContext in a future one.
Makes it more explicit that the variable contains all the state necessary for inference.