Skip to content

Reduce duplication by introducing WherePredicatesOrBool::from_lit - #21

Merged
magiclen merged 1 commit into
magiclen:masterfrom
ijackson:common-lit
Jun 1, 2024
Merged

Reduce duplication by introducing WherePredicatesOrBool::from_lit#21
magiclen merged 1 commit into
magiclen:masterfrom
ijackson:common-lit

Conversation

@ijackson

Copy link
Copy Markdown
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
Copy Markdown
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
@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