Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upParsing of /a{5}/u with the grammar and parsing rule in section B.1.4 #527
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Apr 17, 2017
Member
In Unicode mode, even with Annex B applied, { is not an Atom, as it's not in the set "SourceCharacter but not SyntaxCharacter". Therefore, the fourth production will be the only one that applies. Note that the part of the RegExp grammar that applies to Unicode RegExps is supposed to not have ambiguities (just like the main grammar) and therefore, the ordering does not matter.
|
In Unicode mode, even with Annex B applied, |
littledan
closed this
Apr 17, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nhahtdh
Aug 15, 2017
See comment on issue #526. Anyway, it only affects 6.0 and has been fixed in ECMA 7.0.
nhahtdh
commented
Aug 15, 2017
|
See comment on issue #526. Anyway, it only affects 6.0 and has been fixed in ECMA 7.0. |
nhahtdh commentedApr 7, 2016
According to B.1.4
However, with the regex
/a{5}/u, the expansion:will try
[+U] Atom[U]first. As a result, the regex above will be parsed to a literal sequence ofa{5}, instead ofarepeated 5 times, in Unicode mode.Is this a correct understanding of the specs? Or does the clause "This alternative pattern grammar and semantics only changes the syntax and semantics of BMP patterns." mean that Unicode mode parsing should not follow the parsing rule above?