Skip to content

Conversation

@slinkydeveloper
Copy link
Member

@slinkydeveloper slinkydeveloper commented May 17, 2021

This PR includes:

  • A new visitor to visit the ExpressionInternal tree and mutate it, in order to execute some manipulations (like the constant folding)
  • Introduced BaseUnaryExpression to simplify a bit the visitor thing
  • Implemented ConstantFoldingExpressionVisitor to perform the constant folding
  • Moved ExpressionInternal in expressions package
  • Added some tests covering both the tck with constant folding enabled and with constant folding disabled

In the next PRs I'll reorganize a bit the code in more packages, in order to avoid the mess we have now

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@slinkydeveloper slinkydeveloper added the enhancement New feature or request label May 17, 2021
@slinkydeveloper slinkydeveloper added this to the 2.2 milestone May 17, 2021
@slinkydeveloper
Copy link
Member Author

To simplify the review of the PR, I can split in several PRs

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Constant folding for exists expression

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@slinkydeveloper slinkydeveloper changed the title [WIP][CESQL] Constant folding [CESQL] Constant folding May 18, 2021
Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

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

Great stuff!

LGTM

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
@slinkydeveloper slinkydeveloper merged commit a0b0835 into cloudevents:master Jun 4, 2021
@slinkydeveloper slinkydeveloper deleted the constant_folding branch June 4, 2021 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants