[Bug 11125] Regex grammar for 1.1 renders some 1.0 regexes invalid

http://www.w3.org/Bugs/Public/show_bug.cgi?id=11125

--- Comment #7 from Dave Peterson <davep@iit.edu> 2011-01-19 05:10:34 UTC ---
(In reply to comment #5)

> (2) The grammar in 1.1 has an ambiguity we had not detected before, which may
> affect the rule after production 81.  A single-character escape (e.g. \n)
> satisfies both the non-terminal singleChar and the non-terminal charClassEsc,
> each of which appear on the right-hand side of the rule for charGroupPart, so
> there are two different ways in which a single-character escape can be a
> charGroupPart.  In the case of \n and others of the class, the difference is
> semantically unimportant: in both cases, the enclosing character group includes
> the character indicated.  (As a result, Xerophily does not register this
> ambiguity: both parses produce the same abstract syntax tree.)  
> 
> But in the case of \- the ambiguity may have consequences.  The prose following
> production 81 imposes certain constraints on charGroupPart strings that begin
> with a singleChar followed by a hyphen.  But \- can be either a singleChar or
> not a singleChar; the rule says nothing about a charGroupPart which begins with
> a charClassEsc which happens to be a singleCharEsc, and the rule may be thought
> not to apply to that parse.

I'm inclined to say that   \-   is a singleChar as well as charClassExcape;
being an existentialist rather than an intentionalist, I'd say that the prose
applies, period, regardless of which way the   \-   was legitimized.  But lots
of people think intentionally, so we need to clear it up.

This can be cleared up by mentioning both alternative ways of arriving at   \- 
 in the charGroupPart as though they were different (as suggested by MSM above)
or by asserting that the manner of legitimizing does not change the fact that
they are nonetheless a singleChar and hence the rule applies.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 19 January 2011 05:10:36 UTC