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

Support Conditional ternary operator #53

Merged
merged 4 commits into from
Apr 3, 2024
Merged

Support Conditional ternary operator #53

merged 4 commits into from
Apr 3, 2024

Conversation

zao111222333
Copy link
Contributor

As #52, this PR supports Conditional ternary operator.
Those features have been implemented:

  • BooleanExpression: Add field Cond(Box<BooleanExpression>, Box<BooleanExpression>, Box<BooleanExpression>). And update Display for BooleanExpression.
  • parser: Implement parser for Cond, with priority: imp < cond < or.
  • safe_eval_expression: Implement Cond's BDD with exsited function fn if_then_else(a: &Bdd, b: &Bdd, c: &Bdd) -> Bdd

There is one potential todo validation:

  • Validation on BDD equivalence of A ? B : C and (A & B) | (!A & C)

Copy link

codecov bot commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 90.06%. Comparing base (da57ff9) to head (cd9e9c1).

Files Patch % Lines
src/boolean_expression/_impl_boolean_expression.rs 42.85% 4 Missing ⚠️
src/boolean_expression/_impl_parser.rs 88.23% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
- Coverage   90.30%   90.06%   -0.24%     
==========================================
  Files          25       26       +1     
  Lines        1970     1993      +23     
==========================================
+ Hits         1779     1795      +16     
- Misses        191      198       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@daemontus
Copy link
Member

I'll just merge this as-is and fix the clippy warning on main, so that you don't have to wait for me to re-run the workflow :) Otherwise it looks good, thank you!

@daemontus daemontus merged commit 40b2f72 into sybila:master Apr 3, 2024
4 of 7 checks passed
@daemontus
Copy link
Member

Released as 0.5.13.

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