- From: Michael Dyck <jmdyck@ibiblio.org>
- Date: Sun, 1 May 2016 21:56:04 -0400
- To: Public Joint XSLT XQuery XPath <public-xsl-query@w3.org>
On 16-04-25 06:04 PM, Michael Dyck wrote:
>> ACTION A-640-02a: Mdyck to implemented proposal in the appendix A of the
>> XPath and XQuery specs as described in 2b. See:
>> https://lists.w3.org/Archives/Public/public-xsl-query/2016Mar/0035.html
>
> I've committed this change to the spec source. It'll show up in the rendered
> docs next time Jonathan commits a build.
>
> Specifically, I said that one or more 'symbol separators' are required when
> the colon of a MapConstructorEntry is followed by a QName, an NCName, or "*".
I just noticed an interesting effect of this rule.
Consider the expressions:
map { "a": array }
map { "a": array{} }
In the first, the 'array' token is the QName of a NameTest; in the second,
it's a keyword in an ArrayConstructor.
Due to this distinction, they react differently to deleting the space after
the colon:
map { "a":array }
is disallowed by the above rule, but
map { "a":array{} }
is allowed.
So, to enforce the rule, it's not enough for a lexer to detect that a ":"
token is immediately followed by an "array" token. You have to do some
parsing before you can say whether the "array" is a QName (or NCName) and
thus the expression is illegal.
To make the rule easier to enforce, we might wish to generalize it so that
map { "a":array{} }
is also disallowed.
-Michael
Received on Monday, 2 May 2016 01:56:39 UTC