Skip to content
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

Reduce duplication by introducing WherePredicatesOrBool::from_lit #21

Merged
merged 1 commit into from
Jun 1, 2024

Conversation

ijackson
Copy link
Contributor

Parse for WherePredicatesOrBool and
meta_name_value_2_where_predicates_bool each had a version of this code. I compared each match branch while unifying them, and the two behaviours were identical.

This commit introduces an error handling change for literal that's neither a boolean nor a string: previously Parse for WherePredicatesOrBool would feed it to parse_terminated expecting a WherePredicate, which would fail; and
meta_name_value_2_where_predicates_bool would pass it through to its general error handler. Now we make a bespoke error for this weird case.

(I'm not sure why we have both WherePredicatesOrBool and Bound. I think they could be unified.)

Parse for WherePredicatesOrBool and
meta_name_value_2_where_predicates_bool each had a version of this
code.  I compared each match branch while unifying them, and the two
behaviours were identical.

This commit introduces an error handling change for literal that's
neither a boolean nor a string: previously Parse for
WherePredicatesOrBool would feed it to parse_terminated expecting a
WherePredicate, which would fail; and
meta_name_value_2_where_predicates_bool would pass it through to its
general error handler.  Now we make a bespoke error for this weird
case.

(I'm not sure why we have both WherePredicatesOrBool and Bound.
I think they could be unified.)
@ijackson
Copy link
Contributor Author

This is textually near #22 but the changes don't actually conflict.

@magiclen magiclen merged commit d31d181 into magiclen:master Jun 1, 2024
107 of 155 checks passed
@ijackson ijackson deleted the common-lit branch July 8, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants