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

Fix parser error #1572

Merged
merged 1 commit into from
May 25, 2023
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
4 changes: 1 addition & 3 deletions src/antlr4/Cypher.g4
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,7 @@ oC_PatternElement
;

oC_NodePattern
: '(' SP? ( oC_Variable SP? )? ( oC_NodeLabels SP? )? ( kU_Properties SP? )? ')'
| SP? ( oC_Variable SP? )? ( oC_NodeLabels SP? )? ( kU_Properties SP? )? { notifyNodePatternWithoutParentheses($oC_Variable.text, $oC_Variable.start); }
;
: '(' SP? ( oC_Variable SP? )? ( oC_NodeLabels SP? )? ( kU_Properties SP? )? ')' ;

oC_PatternElementChain
: oC_RelationshipPattern SP? oC_NodePattern ;
Expand Down
10 changes: 0 additions & 10 deletions test/parser/syntax_error_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,6 @@ TEST_F(SyntaxErrorTest, QueryNotConcludeWithReturn2) {
ASSERT_STREQ(expectedException.c_str(), getParsingError(input).c_str());
}

TEST_F(SyntaxErrorTest, QueryNodeWithOutParentheses) {
std::string expectedException =
"Parser exception: Parentheses are required to identify nodes in "
"patterns, i.e. (a) (line: 1, offset: 6)\n";
expectedException += "\"MATCH a RETURN *;\"\n";
expectedException += " ^";
auto input = "MATCH a RETURN *;";
ASSERT_STREQ(expectedException.c_str(), getParsingError(input).c_str());
}

TEST_F(SyntaxErrorTest, InvalidNotEqualOperator) {
std::string expectedException =
"Parser exception: Unknown operation '!=' (you probably meant to use '<>', which is "
Expand Down
Loading