Skip to content

Variable together with single star in variable length pattern now is recognized as list. #75

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

Merged
merged 1 commit into from
Nov 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,9 @@ PatternElementChain ::= RelationshipPattern NodePattern {pin=1}

RelationshipPattern ::= LeftArrowHead? Dash RelationshipDetail? Dash RightArrowHead? {pin=2}

RelationshipDetail ::= "[" Variable? "?"? RelationshipTypes? MaybeVariableLength Properties? "]" {pin=1}
RelationshipDetail ::= "[" Variable? "?"? RelationshipTypes? MaybeVariableLength? Properties? "]" {pin=1}
RelationshipTypes ::= ":" RelTypeName ("|" ":"? RelTypeName)* {pin=1}
MaybeVariableLength ::= ("*" RangeLiteral?)?
MaybeVariableLength ::= ("*" RangeLiteral?)

NodePattern ::= "(" Variable? NodeLabels? Properties? ")" {pin=1}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ default CypherType getType() {

default CypherType resolveRelationshipType(CypherRelationshipDetail relationshipDetail) {
CypherMaybeVariableLength maybeVariableLength = relationshipDetail.getMaybeVariableLength();
return nonNull(maybeVariableLength.getRangeLiteral()) ? CypherList.of(RELATIONSHIP) : RELATIONSHIP;
return nonNull(maybeVariableLength) ? CypherList.of(RELATIONSHIP) : RELATIONSHIP;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,8 @@ public void testRelationshipSizeWithVariableLength() {
addDataSourceFileAndCheck("MATCH (a)-[c*1..1]->(b) WITH size(c) as derp RETURN derp");
}

public void testRelationshipSizeWithStar() {
addDataSourceFileAndCheck("MATCH (a)-[c*]->(b) WITH size(c) as derp RETURN derp");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,6 @@ Cypher file: FILE(0,923)
PsiElement(-)('-')(743,744)
CypherRelationshipDetailImpl(RELATIONSHIP_DETAIL)(744,746)
PsiElement([)('[')(744,745)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(745,745)
<empty list>
PsiElement(])(']')(745,746)
CypherDashImpl(DASH)(746,747)
PsiElement(-)('-')(746,747)
Expand Down Expand Up @@ -662,4 +660,4 @@ Cypher file: FILE(0,923)
PsiElement(string)('"str \n"')(902,910)
PsiElement(AND)('AND')(911,914)
CypherStringLiteralImpl(STRING_LITERAL)(915,923)
PsiElement(string)('"str \""')(915,923)
PsiElement(string)('"str \""')(915,923)
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ Cypher file: FILE(0,86)
PsiElement(-)('-')(11,12)
CypherRelationshipDetailImpl(RELATIONSHIP_DETAIL)(12,14)
PsiElement([)('[')(12,13)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(13,13)
<empty list>
PsiElement(])(']')(13,14)
CypherDashImpl(DASH)(14,15)
PsiElement(-)('-')(14,15)
Expand Down Expand Up @@ -81,8 +79,6 @@ Cypher file: FILE(0,86)
PsiElement(-)('-')(44,45)
CypherRelationshipDetailImpl(RELATIONSHIP_DETAIL)(45,47)
PsiElement([)('[')(45,46)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(46,46)
<empty list>
PsiElement(])(']')(46,47)
CypherDashImpl(DASH)(47,48)
PsiElement(-)('-')(47,48)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,6 @@ Cypher file: FILE(0,751)
PsiElement(-)('-')(296,297)
CypherRelationshipDetailImpl(RELATIONSHIP_DETAIL)(297,299)
PsiElement([)('[')(297,298)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(298,298)
<empty list>
PsiElement(])(']')(298,299)
CypherDashImpl(DASH)(299,300)
PsiElement(-)('-')(299,300)
Expand Down Expand Up @@ -506,8 +504,6 @@ Cypher file: FILE(0,751)
CypherSymbolicNameStringImpl(SYMBOLIC_NAME_STRING)(316,319)
CypherUnescapedSymbolicNameStringImpl(UNESCAPED_SYMBOLIC_NAME_STRING)(316,319)
PsiElement(identifier)('var')(316,319)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(319,319)
<empty list>
PsiElement(])(']')(319,320)
CypherDashImpl(DASH)(320,321)
PsiElement(-)('-')(320,321)
Expand Down Expand Up @@ -556,8 +552,6 @@ Cypher file: FILE(0,751)
CypherSymbolicNameStringImpl(SYMBOLIC_NAME_STRING)(341,345)
CypherUnescapedSymbolicNameStringImpl(UNESCAPED_SYMBOLIC_NAME_STRING)(341,345)
PsiElement(identifier)('Type')(341,345)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(345,345)
<empty list>
PsiElement(])(']')(345,346)
CypherDashImpl(DASH)(346,347)
PsiElement(-)('-')(346,347)
Expand Down Expand Up @@ -606,8 +600,6 @@ Cypher file: FILE(0,751)
CypherSymbolicNameStringImpl(SYMBOLIC_NAME_STRING)(367,371)
CypherUnescapedSymbolicNameStringImpl(UNESCAPED_SYMBOLIC_NAME_STRING)(367,371)
PsiElement(identifier)('Type')(367,371)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(371,371)
<empty list>
PsiElement(])(']')(371,372)
CypherDashImpl(DASH)(372,373)
PsiElement(-)('-')(372,373)
Expand Down Expand Up @@ -651,8 +643,6 @@ Cypher file: FILE(0,751)
CypherUnescapedSymbolicNameStringImpl(UNESCAPED_SYMBOLIC_NAME_STRING)(389,392)
PsiElement(identifier)('var')(389,392)
PsiElement(?)('?')(392,393)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(393,393)
<empty list>
PsiElement(])(']')(393,394)
CypherDashImpl(DASH)(394,395)
PsiElement(-)('-')(394,395)
Expand Down Expand Up @@ -702,8 +692,6 @@ Cypher file: FILE(0,751)
CypherSymbolicNameStringImpl(SYMBOLIC_NAME_STRING)(416,420)
CypherUnescapedSymbolicNameStringImpl(UNESCAPED_SYMBOLIC_NAME_STRING)(416,420)
PsiElement(identifier)('Type')(416,420)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(420,420)
<empty list>
PsiElement(])(']')(420,421)
CypherDashImpl(DASH)(421,422)
PsiElement(-)('-')(421,422)
Expand Down Expand Up @@ -758,8 +746,6 @@ Cypher file: FILE(0,751)
CypherSymbolicNameStringImpl(SYMBOLIC_NAME_STRING)(448,452)
CypherUnescapedSymbolicNameStringImpl(UNESCAPED_SYMBOLIC_NAME_STRING)(448,452)
PsiElement(identifier)('Type')(448,452)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(452,452)
<empty list>
PsiElement(])(']')(452,453)
CypherDashImpl(DASH)(453,454)
PsiElement(-)('-')(453,454)
Expand Down Expand Up @@ -813,8 +799,6 @@ Cypher file: FILE(0,751)
CypherSymbolicNameStringImpl(SYMBOLIC_NAME_STRING)(479,483)
CypherUnescapedSymbolicNameStringImpl(UNESCAPED_SYMBOLIC_NAME_STRING)(479,483)
PsiElement(identifier)('Type')(479,483)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(483,483)
<empty list>
PsiElement(])(']')(483,484)
CypherDashImpl(DASH)(484,485)
PsiElement(-)('-')(484,485)
Expand Down Expand Up @@ -1127,8 +1111,6 @@ Cypher file: FILE(0,751)
CypherSymbolicNameStringImpl(SYMBOLIC_NAME_STRING)(648,651)
CypherUnescapedSymbolicNameStringImpl(UNESCAPED_SYMBOLIC_NAME_STRING)(648,651)
PsiElement(identifier)('var')(648,651)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(652,652)
<empty list>
CypherPropertiesImpl(PROPERTIES)(652,659)
CypherParameterImpl(PARAMETER)(652,659)
CypherOldParameterImpl(OLD_PARAMETER)(652,659)
Expand Down Expand Up @@ -1179,8 +1161,6 @@ Cypher file: FILE(0,751)
CypherSymbolicNameStringImpl(SYMBOLIC_NAME_STRING)(677,680)
CypherUnescapedSymbolicNameStringImpl(UNESCAPED_SYMBOLIC_NAME_STRING)(677,680)
PsiElement(identifier)('var')(677,680)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(681,681)
<empty list>
CypherPropertiesImpl(PROPERTIES)(681,695)
CypherMapLiteralImpl(MAP_LITERAL)(681,695)
PsiElement({)('{')(681,682)
Expand Down Expand Up @@ -1235,8 +1215,6 @@ Cypher file: FILE(0,751)
CypherSymbolicNameStringImpl(SYMBOLIC_NAME_STRING)(713,716)
CypherUnescapedSymbolicNameStringImpl(UNESCAPED_SYMBOLIC_NAME_STRING)(713,716)
PsiElement(identifier)('var')(713,716)
CypherMaybeVariableLengthImpl(MAYBE_VARIABLE_LENGTH)(717,717)
<empty list>
CypherPropertiesImpl(PROPERTIES)(717,745)
CypherMapLiteralImpl(MAP_LITERAL)(717,745)
PsiElement({)('{')(717,718)
Expand Down Expand Up @@ -1268,4 +1246,4 @@ Cypher file: FILE(0,751)
CypherUnescapedSymbolicNameStringImpl(UNESCAPED_SYMBOLIC_NAME_STRING)(748,749)
PsiElement(identifier)('n')(748,749)
PsiElement())(')')(749,750)
PsiElement(;)(';')(750,751)
PsiElement(;)(';')(750,751)