https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102447

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I have looked in detail (I have the 3rd, 4th and 5th editions here) but my
brain started oozing out of my ears.

15.10.2.15 NonemptyClassRanges and 15.10.2.16 NonemptyClassRangesNoDash are the
relevant sections of the 1999 3rd edition. The former defines:

  The internal helper function CharacterRange takes two CharSet parameters
  A and B and performs the following:
  1. If A does not contain exactly one character or B does not contain exactly
  one character then throw a SyntaxError exception.

And the latter has this note:

  Informative comments: ClassRanges can expand into single ClassAtoms and/or
  ranges of two ClassAtoms separated by dashes. In the latter case the
  ClassRanges includes all characters between the first ClassAtom and the
  second ClassAtom, inclusive; an error occurs if either ClassAtom does not
  represent a single character (for example, if one is \w) or if the first
  ClassAtom's code point value is greater than the second ClassAtom's code
  point value.



The ClassAtom \w does not contain exactly one character, so I think it's a
syntax error.

The 3rd edition doesn't mention any legacy features of RegExp, but it does seem
to require the strict behaviour.

Reply via email to