-
Notifications
You must be signed in to change notification settings - Fork 29
Fixed parser so that square brackets count as delimiters #121
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
Conversation
$token = substr($token, 1, -1); | ||
if ($token === '[') { | ||
$token = $this->scanner->fetchNextToken(); | ||
$endDelimiter = $this->scanner->fetchNextToken(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should simply be $this->scanner->expectToken(']');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
yeah, [] are used for indexes and are not legal in a node name. however, i am not entirely sure if this change could lead to some regression somewhere in jackalope, when we assume that is using square brakets for index in multivalue lists something ever used by jcr sql2? i think not, as you don't care about position in a multivalue. |
tests seem to be flaky on HHVM .. some of the tests sometimes fail with a 1 second timeout |
7f7d830
to
389396b
Compare
as you might be aware Oak does not support SNS and there is a discussion about how to deal with people importing content with SNS, so they are discussing how to deal with square brackets in node names. maybe this discussions will give some hints: |
So just to clarify - does this change (using square brackets in an UPDATE in PHPCR-Shell) conflict with SNS? I guess it shouldn't, i.e. SNS square brackets are only used on paths, whereas the UPDATE square brackets are only used on properties. I guess in any case it shouldn't be hard to support SNS notation with this change. |
the concern is just that this change MIGHT break parsing of SNS paths inside queries. ie. for example |
As we only ever update properties and never whole nodes i think Dan is right. ----- Reply message ----- I guess it shouldn't, i.e. SNS square brackets are only used on paths, whereas the UPDATE square brackets are only used on properties. I guess in any case it shouldn't be hard to support SNS notation with this change. — |
Are we OK to merge this? |
lets merge. ok @lsmith77 ? |
Fixed parser so that square brackets count as delimiters
i think this breaks jackalope: https://travis-ci.org/jackalope/jackalope-jackrabbit/jobs/37503114 |
ok, I wasn't aware that there were tests for these classes in the API tests. The other problems are "ok" - they make sense and I guess just need to be updated, but this one is odd:
Caused by this:
Why are there square brackets there? Is the spec suggesting that the square brackets are part of the grammer, or simply that it is an optional thing? But we can revert first and ask questions later if needs be :) |
as long as we don't tag a release lets see if we can clear this up without reverting. created #131 |
This is an "enabling" improvement which allows me to use the parser to parse things like:
Square brackets are delimiters in JCR-SQL2 (right?) so I think this is valid without compromise.