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

Allow escaping labels and property keys for TCK Cypher Value Parser #317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DarthMax
Copy link
Contributor

No description provided.

Copy link
Member

@Mats-SX Mats-SX left a comment

Choose a reason for hiding this comment

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

Is the point simply to allow wrapping backticks, or to extend the support of these symbols to be able to contain whitespace? If the former; no additional comments, if the latter: there should be tests for whitespace-containing labels, properties and rel-types.

test("relationship") {
val string = "[:A {since: 1920}]"
val parsed = CypherValue(string)
val expected = CypherRelationship("A", CypherPropertyMap(Map("since" -> CypherInteger(1920))))
parsed should equal(expected)
}

test("relationship with escaped label") {
Copy link
Member

Choose a reason for hiding this comment

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

escaped type


relationshipTypeName : SYMBOLIC_NAME ;

label : ':' labelName ;
label : ':' (labelName | ('`' labelName '`')) ;
Copy link
Member

Choose a reason for hiding this comment

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

Since all these three rules resolve to the same lexer rule SYMBOLIC_NAME, perhaps we could simplify the change by introducing an in-between parser rule symbolicName that allows escaping?

Like

propertyKey: symbolicName ;
relationshipTypeName: symbolicName ;
labelName: symbolicName ;
symbolicName: '`' SYMBOLIC_NAME '`' ;

@Mats-SX
Copy link
Member

Mats-SX commented Nov 13, 2018

@DarthMax Is this still something we need?

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.

2 participants