typeql
typeql copied to clipboard
TypeQL ParsePattern throws syntax error for basic conjunction
Description
Java's ParsePattern
is throwing unexpected syntax errors for basic conjunctions. This is if the conjunction is given without surrounding {}
. With the enclosing braces the conjunction is parsed correctly.
Environment
- OS (where TypeDB server runs): Mac OS 10
- Grakn version (and platform): Grakn Core 2.14.0
- TypeDB client: client-java
Reproducible Steps
Steps to create the smallest reproducible scenario:
Try parsing the following query
Pattern expected = TypeDB.parsePattern("$x isa person, has age 10;");
Expected Output
This was expected to parse the query into a conjunction.
Actual Output
[TQL03] TypeQL Error: There is a syntax error at line 1:
$x isa person, has age 10;
^
extraneous input ';' expecting <EOF>
Additional information
Enclosing with {}
parses correctly:
Pattern expected = TypeQL.parsePattern("{$x isa person, has age 10;}");
Related to #134
This is still an issue - testing the parser for the pattern
rule fails for something as simple as $x isa person;
This is in our grammar, a conjunction is matched after a variable, and only conjunctions are parsed with a trailing ;
(issue updated to reflect)