-
Notifications
You must be signed in to change notification settings - Fork 150
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
WHERE leading whitespace #348
Comments
I believe you've found a bug. I agree with the proposed change. I'd be happy to review a PR if one appears, otherwise we'll pick this up at some point. Thanks for the report! |
I have a slight preference for inserting the whitespace at the point of reference rather than into the production rule for |
Just to clarify, I don't feel strongly on where
I would be in favour of removing the explicit whitespace declarations in favour of general rules, if those rules could be formulated succinctly without lots of special cases. |
Maybe from a grammar design perspective i would also prefer to have the whitespace at the point of reference. After all "a SP b SP c" is easier to read than "a SP b c" where c starts with SP. But on the other hand (for my purpose), i'm working on letting the user supply nodes in the grammar (like a querybuilder). Now for each concatenation/sequence i have a node in the grammar. But the concatenation |
I looked around where the
WHERE
rule was being used. In all places except one it's used in the EBNF as[[SP], Where]
. The place where it's not used with the leadingSP
(whitespace) is hereopenCypher/grammar/start.xml
Line 47 in b60f0f8
When following StartPoint (the line before, 46):
StartPoint
ends withLookup
Lookup
ends withNodeLookup
orRelationshipLookup
NodeLookup
andRelationshipLookup
end withIdentifiedIndexLookup
orIndexQuery
orIdLookup
IdentifiedIndexLookup
andIndexQuery
andIdLookup
all end with token)
That's strange that in this case
)
must be immediately followed with tokenWHERE
without whitespace in between. Maybe this is a mistake in the grammar? In case the grammar would change to also put whitespace in this location, i would suggest to put the whitespace in theWHERE
rule itself.Old rule:
Where = (W,H,E,R,E), SP, Expression ;
New rule:
Where = SP, (W,H,E,R,E), SP, Expression ;
The text was updated successfully, but these errors were encountered: