-
Notifications
You must be signed in to change notification settings - Fork 675
Implement ASSERT statement #226
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
Conversation
Pull Request Test Coverage Report for Build 171535046
💛 - Coveralls |
nickolay
left a comment
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.
LGTM!
src/ast/mod.rs
Outdated
|
|
||
| /// ASSERT <condition> [AS <message>] | ||
| Assert { | ||
| condition: Box<Expr>, |
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.
Do you need Box here?
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.
Removed! Probably doesn't matter much in this case, and makes it easier to read. Would maybe be interesting in the future to see how much bytes we are using per struct (and impact on perf / memory).
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 assume that the only two cases when we should use Box in our AST are: cycles (e.g. Expr) and when clippy reports a large_enum_variant.
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.
That's probably a good heuristic indeed.
|
Thanks! |
Issue: #225
See:
https://cloud.google.com/bigquery/docs/reference/standard-sql/debugging-statements
https://www.postgresql.org/docs/10/plpgsql-errors-and-messages.html
PostgreSQL supports an arbitrary expression as optional second message, so made that an expression as well.