-
Notifications
You must be signed in to change notification settings - Fork 46
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
Introduce expressions and computed value variables #260
Merged
flyingsilverfin
merged 14 commits into
typedb:master
from
krishnangovindraj:arithmetic-different-syntax-for-values
May 26, 2023
Merged
Introduce expressions and computed value variables #260
flyingsilverfin
merged 14 commits into
typedb:master
from
krishnangovindraj:arithmetic-different-syntax-for-values
May 26, 2023
Commits on May 26, 2023
-
WIP: Filling in parser WIP: Filled in all(?) parser functions expand * import Adapt to Variable/Pattern architecture Try to write a test; Exception: Assignment has no namedVariable Use $ for EvaluableVariables too Simplify grammar - Remove atom Add temporary test showing thing-type duality is not handled by the parser Fix grammar & add parser tests Add accessor for EvaluableConstriant.expression Refine EvaluableConstraint constants Add accessors for EvaluableExpression Introduce safe-casting methods for EvaluableVariable and EvaluableConstraint Expressions hold UnboundVariables; EvaluableConstraint inputs are ConceptVariables Fix EvaluableConstraint::variables Make the symbol field for OP enum accessible Remove comment Use '?' for Value variables. Introduce special syntax for value variables; Remove assignment in favour of overloading equality predicate Reintroduce assignment as easy mid-point Some more changes for re-introducing assign Temporarily disable expressions in valueconstraint; tests still fail Make predicate a common construct used by EvaluableVarables and ThingVariables 1/2: Pull up UnboundVariable, Replace with UnboundDollarVariable class 2/2 - Finish & unify predicates so ValueConstraints don't duplicate Add some more EvaluableExpression.Constant builder functions; Fix formatting Fix checkstyle Split Reference.Name into Name.NamedDollar and Name.NamedVal Fix another checkstyle 1/2: Rename {Thing,Evaluable}Constraint.Value to Predicate 2/2 Rename Evaluable -> Value Rename EvaluableExpression -> Expression Rename Predicate.Variable to Predicate.ThingVariable Resolve TODOs Replace NamedVal with NamedValue Small refactor of grammar Update equality check to '=='; assignment to '=' Add static import for pattern.expression.Predicate in TypeQL.java Rename UnboundValueVariable.namedValue -> UnboundValueVariable.named; Static import in ParserTest Static import for pattern.expression.Predicate in ThingVariableBuilder Point typedb-behaviour to myfork Better usages to differentiate between UnboundDollar and UnboundValue Update Match query conjunction bound test to include value variables Improve Named variable methods in TypeQLInsert and TypeQL Delete Allow aggregation on value variables Extend ThingConstraint.has to return attribute identity variables Changes for sorting on value variable Rename grammar symbol from EVAR_ to VALVAR_; Fix formatting Rearrange new grammar rules Fix Formatting till and including pattern.constraint Remove Type Parameter for {Thing,Value}Constraint.Predicate Work through warnings Fix more warnings & formatting Rearrange grammar & parser Introduce modulo-remainder operator; Make POW right-associative; Rearrange grammar; Dissolve pattern.expression package - move predicate up, Expression into ValueConstraint Create ValueVariableBuilder interface; Make UnboundValueVariable implement that simplify a bit Simplify query/ Refactor grammar a bit more Enable grouping on value variables in grammar Refactor grammar a little more Change only the grammar implement changes to parser Revert ThingVariable TypeVariable to not extend ConceptVariable Rename UnboundConceptVariable to UnboundThingTypeVariable Reflect renaming UnboundConceptVariable -> UnboundThingTypeVariable in grammar Unecessary cast in bound contains Remove ThingVariableBuilder.Root, before re-introducing it Rename ThingType to concept; Revert grammar to Concept and value Disable ?y; Explicitly enable has age ?a; Incorporate PR comments in grammar, TypeQLToken Incorporate changes to Parser, builder methods Incorporate more review comments Refactor Reference: Introduce Value class as sibling to Name; Use Variable.isNamed to check if Named or Value Incorporate more PR comments More comments incorporated Incorporate more PR feedback Simplify ThingConstraint.Has.variables() Some more comments Introduce ExpressionBuilder interface; Update builder methods to use them Add license to header in ExpressionBuilder Revert ConceptConstraint to the simpler signature Explicitly declare available functions in the grammar Add license header to ValueVariableBuilder Move PredicateBuilder implementation from ValueVariableBuilder to UnboundValueVariable Make the ParserTest for functions make more sense Incorporate comments Add ExpressionBuilder.plus, .minus, ... methods Rename arglist to args Rename expression function rules reintroduce variable name APIs for modifiers & aggregatables; only to remove them again Remove string api for modifier_vars Spacing in grammar More spacing Rename modifier_vars to var_referable Rename var to cVar and valueVar to vVar Checkstyle Typo in grammar unary operators are no longer handled in lexer, allowing spaceless ?x = 5+2; Move var_referable rule to VAR_* tokens section replace var_referable with VAR_CONCEPT_ | VAR_VALUE_ Align section separator endings (// ... ===) to 80 characters Align (VAR_CONCEPT_ | VAR_REFERABLE_ ) better Replace var_referable to VAR_CONCEPT_|VAR_VALUE_;Expand short rule names - expr*->expression* ; func -> function* Replace PAREN_OPEN/CLOSE in favour literal ( ) Replace rogue replace expresses -> expressionesses Replace redundant Operation enum in AssignmentConstraint with TypeQLToken Operation Use Function Enum in ValueConstraint.Expression PR refactor: remove needless qualifications Collapse all expression non-terminals to a single rule Fix Expression.Constant.String.toString; Introduce TypeQLStep for exceptions containing Backward compatibility for '=' in ThingVariable predicates Update missing var -> cVar Update arithmetic parser tests to reflect new rule synatx Refactor Reference.Refereable into Reference.Name Move Concept and Value into Reference.Name Fix equality function
Configuration menu - View commit details
-
Copy full SHA for d9ce296 - Browse repository at this point
Copy the full SHA d9ce296View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3092689 - Browse repository at this point
Copy the full SHA 3092689View commit details -
Ensure that variable names are unique
Add parser test Fix recursion Test and fix variable name clash
Configuration menu - View commit details
-
Copy full SHA for b71deb9 - Browse repository at this point
Copy the full SHA b71deb9View commit details -
WIP working on centralising Expressions, repeat for Predicates
Simplifying expressions, rename bracket to parenthesis Predicate constraints extract variables and convert to bound
Configuration menu - View commit details
-
Copy full SHA for e012ed4 - Browse repository at this point
Copy the full SHA e012ed4View commit details -
Configuration menu - View commit details
-
Copy full SHA for b0fb81f - Browse repository at this point
Copy the full SHA b0fb81fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 83d7459 - Browse repository at this point
Copy the full SHA 83d7459View commit details -
Configuration menu - View commit details
-
Copy full SHA for 411c3fa - Browse repository at this point
Copy the full SHA 411c3faView commit details -
Configuration menu - View commit details
-
Copy full SHA for afdd187 - Browse repository at this point
Copy the full SHA afdd187View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac45176 - Browse repository at this point
Copy the full SHA ac45176View commit details -
Configuration menu - View commit details
-
Copy full SHA for db52b37 - Browse repository at this point
Copy the full SHA db52b37View commit details -
Configuration menu - View commit details
-
Copy full SHA for b9697d5 - Browse repository at this point
Copy the full SHA b9697d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 82b2067 - Browse repository at this point
Copy the full SHA 82b2067View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1691194 - Browse repository at this point
Copy the full SHA 1691194View commit details -
Configuration menu - View commit details
-
Copy full SHA for dc18b73 - Browse repository at this point
Copy the full SHA dc18b73View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.