Skip to content
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

Chaining of non arithmetic operators #542

Merged
merged 2 commits into from
Dec 16, 2022

Conversation

hvub
Copy link
Contributor

@hvub hvub commented Aug 30, 2022

This PR is based on #541.

This PR proposes changes to the openCypher grammar for allowing chaining of non-arithmetic operators as a reaction to issue #539. With the PR, the grammar allows for instance

RETURN foo()[1]:F, foo().x.y[1][4].name:F

as valid syntax, which was not the case before.

The PR also adjusts CIP2021-08-10 Operator precedence (rendered view) to the changed grammar.

@hvub hvub changed the title Chaining of non arithmatic operators Chaining of non arithmetic operators Aug 30, 2022
@hvub hvub force-pushed the chaining-of-non-arithmatic-operators branch 2 times, most recently from 6da0d76 to 475f73c Compare September 20, 2022 08:10
@nadja-muller nadja-muller self-assigned this Oct 28, 2022
Copy link

@nadja-muller nadja-muller left a comment

Choose a reason for hiding this comment

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

It looks like this solves the problem described in the issue to me 👍

As a sidenote, comparing it with Cypher (Postfix1 in the code), I think there are some differences:

  • We additionally allow listSlices, e.g. 1..2 in the same hierarchy as listOperatorExpression and PropertyLookups. I assume this is part of openCypher.
  • We allow node & relationship expressions instead of only NodeLabels.

@jonaskello
Copy link

jonaskello commented Dec 12, 2022

Just ran into the issue that list[0].myprop will not parse properly, but (list[0]).myprop works. From what I understand this PR will fix that. Is there a timeline for when it will be merged/released?

@hvub hvub force-pushed the chaining-of-non-arithmatic-operators branch from 475f73c to 14fc067 Compare December 16, 2022 08:16
@hvub hvub merged commit 7f6cfeb into opencypher:master Dec 16, 2022
@hvub hvub deleted the chaining-of-non-arithmatic-operators branch December 16, 2022 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants