Skip to content

Commit

Permalink
Fix recursive issue (#3694)
Browse files Browse the repository at this point in the history
  • Loading branch information
acquamarin committed Jun 24, 2024
1 parent 742227a commit a340551
Show file tree
Hide file tree
Showing 4 changed files with 1,165 additions and 1,143 deletions.
2 changes: 1 addition & 1 deletion scripts/antlr4/Cypher.g4.copy
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ oC_RangeLiteral
: '*' SP? ( SHORTEST | ALL SP SHORTEST )? SP? (oC_LowerBound? SP? '..' SP? oC_UpperBound? | oC_IntegerLiteral)? (SP? kU_RecursiveRelationshipComprehension)? ;

kU_RecursiveRelationshipComprehension
: '(' SP? oC_Variable SP? ',' SP? oC_Variable ( SP? '|' SP? oC_Where )? ( SP? '|' SP? kU_IntermediateRelProjectionItems SP? ',' SP? kU_IntermediateNodeProjectionItems SP? )? ')' ;
: '(' SP? oC_Variable SP? ',' SP? oC_Variable ( SP? '|' SP? oC_Where SP? )? ( SP? '|' SP? kU_IntermediateRelProjectionItems SP? ',' SP? kU_IntermediateNodeProjectionItems SP? )? ')' ;

kU_IntermediateNodeProjectionItems
: '{' SP? oC_ProjectionItems? SP? '}' ;
Expand Down
2 changes: 1 addition & 1 deletion src/antlr4/Cypher.g4
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ oC_RangeLiteral
: '*' SP? ( SHORTEST | ALL SP SHORTEST )? SP? (oC_LowerBound? SP? '..' SP? oC_UpperBound? | oC_IntegerLiteral)? (SP? kU_RecursiveRelationshipComprehension)? ;

kU_RecursiveRelationshipComprehension
: '(' SP? oC_Variable SP? ',' SP? oC_Variable ( SP? '|' SP? oC_Where )? ( SP? '|' SP? kU_IntermediateRelProjectionItems SP? ',' SP? kU_IntermediateNodeProjectionItems SP? )? ')' ;
: '(' SP? oC_Variable SP? ',' SP? oC_Variable ( SP? '|' SP? oC_Where SP? )? ( SP? '|' SP? kU_IntermediateRelProjectionItems SP? ',' SP? kU_IntermediateNodeProjectionItems SP? )? ')' ;

kU_IntermediateNodeProjectionItems
: '{' SP? oC_ProjectionItems? SP? '}' ;
Expand Down
8 changes: 8 additions & 0 deletions test/test_files/issue/issue7.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@
-CASE issue3607
-STATEMENT CREATE NODE TABLE as (id UUID, PRIMARY KEY (id));
---- ok

-CASE issue3692
-STATEMENT CREATE NODE TABLE V (id INT64, PRIMARY KEY(id));
---- ok
-STATEMENT CREATE REL TABLE E(FROM V TO V);
---- ok
-STATEMENT MATCH (a:V)-[e* (r, n | WHERE n.id < 4 )]->(b:V {id: 4}) RETURN *;
---- 0
Loading

0 comments on commit a340551

Please sign in to comment.