-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce expressions and computed value variables in typeql-rust (#294)
## What is the goal of this PR? We introduce in `typeql-rust` the ability to perform arithmetic computation and store the results in a "value variable" - denoted by a preceding `?`, the same as introduced in `typeql-java` by #260. All redundant parenthesis from original query will not persist in the string representation of the parsed expression anymore. If we get this query: ``` match $p isa person, has salary $s; ?net = (($s - 12500) * 0.8 + 12500); ``` it will be transformed into ``` match $p isa person, has salary $s; ?net = ($s - 12500) * 0.8 + 12500; ``` ## What are the changes implemented in this PR? In addition to changes implemented in #260: - We removed `Parenthesis` class and do not store parenthesis in the expression tree anymore. When we build a string representation of the expression, we add all necessary parenthesis. Nevertheless, if we get something like `a + (b + c)`, these parenthesis will persist in the resulting string representation.
- Loading branch information
Showing
48 changed files
with
2,465 additions
and
671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.