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

Refactor list comprehension & bug fixes #8

Merged
merged 2 commits into from
Jul 29, 2024
Merged

Refactor list comprehension & bug fixes #8

merged 2 commits into from
Jul 29, 2024

Conversation

danielgerlag
Copy link
Contributor

  • Fixes the WHERE clauses interpreted as list filters when following a WITH projection without an AS bug
  • Refactored expression evaluation logic out of the reduce function, and into the expression evaluator
  • Encapsulated list comprehension evaluation around the IteratorExpression
  • Removed redundant expression variants
  • Added LazyScalar function type for functions that do not want the args pre-resolved
  • Additional test cases

Copy link

Test Results

457 tests  +3   457 ✅ +3   0s ⏱️ ±0s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 163b710. ± Comparison against base commit 2a3b1d5.

@@ -241,6 +234,32 @@ peg::parser! {
"[" __* c:expression() ** (__* "," __*) __* "]" { ListExpression::list(c) }
}

#[cache_left_rec]
rule iterator() -> Expression
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow 😍 looks so much better

ast::BinaryExpression::Eq(var, val) => {
let variable = match *var.clone() {
ast::Expression::UnaryExpression(exp) => match exp {
ast::UnaryExpression::Identifier(ident) => ident,
Copy link
Contributor

@ruokun-niu ruokun-niu Jul 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry what would be an example of an identifier expression again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like a variable, eg. x from the expression: x = 1

@danielgerlag danielgerlag merged commit 55c10eb into main Jul 29, 2024
8 checks passed
@danielgerlag danielgerlag deleted the 11641 branch September 23, 2024 19:22
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.

3 participants