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

Add assert expression #1845

Merged
merged 6 commits into from
May 15, 2024
Merged

Add assert expression #1845

merged 6 commits into from
May 15, 2024

Conversation

de1iza
Copy link
Contributor

@de1iza de1iza commented Jan 13, 2024

This PR adds an assert (CONDITION, ERROR) expression, which takes a boolean CONDITION, and errors out with the value of ERROR if CONDITION is false.

I extracted lhs, rhs and operator out of Conditional into a separate struct Condition, as it is now shared with Assert expression.

Fixes #1657.

@de1iza de1iza changed the title Add assert expression Add assert expression Jan 13, 2024
@de1iza
Copy link
Contributor Author

de1iza commented Mar 7, 2024

Hi @casey, I was wondering if you could review my PR.

@casey
Copy link
Owner

casey commented May 15, 2024

Nice work! Made some minor changes, but otherwise looks good to me!

@casey casey enabled auto-merge (squash) May 15, 2024 01:54
@casey casey merged commit 9aea3e6 into casey:master May 15, 2024
5 checks passed
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.

Make the else branch of a conditional optional
2 participants