Skip to content

Commit

Permalink
Split StringListNullOperationExpression to specific parts. Ref. #321
Browse files Browse the repository at this point in the history
Signed-off-by: Jozsef Marton <[email protected]>
  • Loading branch information
jmarton committed Aug 16, 2018
1 parent c8888ea commit a514465
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions grammar/basic-grammar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -244,22 +244,38 @@
<production name="StringListNullOperatorExpression" rr:inline="true">
<non-terminal ref="PropertyOrLabelsExpression"/>
<repeat><alt>
<non-terminal ref="StringOperatorExpression"/>
<non-terminal ref="ListOperatorExpression"/>
<non-terminal ref="NullOperatorExpression"/>
</alt></repeat>
</production>

<production name="ListOperatorExpression" rr:inline="true">
<alt>
<seq> &WS; [ &expr; ] </seq>
<seq> &WS; [ <opt>&expr;</opt> .. <opt>&expr;</opt> ] </seq>
<seq>
<alt>
<non-terminal ref="RegularExpression"/>
<seq>&SP; IN</seq>
<seq>&SP; STARTS &SP; WITH</seq>
<seq>&SP; ENDS &SP; WITH</seq>
<seq>&SP; CONTAINS</seq>
</alt>
&WS;
<non-terminal ref="PropertyOrLabelsExpression"/>
</seq>
</alt>
</production>

<production name="StringOperatorExpression" rr:inline="true">
<seq>
<alt>
<non-terminal ref="RegularExpression"/>
<seq>&SP; IN</seq>
<seq>&SP; STARTS &SP; WITH</seq>
<seq>&SP; ENDS &SP; WITH</seq>
<seq>&SP; CONTAINS</seq>
</alt>
&WS;
<non-terminal ref="PropertyOrLabelsExpression"/>
</seq>
</production>

<production name="NullOperatorExpression" rr:inline="true">
<alt>
<seq> &SP; IS &SP; NULL </seq>
<seq> &SP; IS &SP; NOT &SP; NULL </seq>
</alt></repeat>
</alt>
</production>

<production name="RegularExpression" oc:legacy="true">
Expand Down

2 comments on commit a514465

@Izhaki
Copy link

@Izhaki Izhaki commented on a514465 Nov 3, 2018

Choose a reason for hiding this comment

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

I may be wrong about this, but I believe that in the following query:

MATCH (n) WHERE id(n) IN [0, 3, 5] RETURN n

The parser matches the IN in StringOperatorExpression - but this IN is a list rather than string operator.

@Mats-SX
Copy link
Member

@Mats-SX Mats-SX commented on a514465 Nov 8, 2018

Choose a reason for hiding this comment

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

You are right; IN is only defined for list-typed right-hand sides. We should probably move it into the ListOperatorExpression rule instead.

Please sign in to comment.