-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Description: Value of the parameter NamedCaptureGroups should be defined for the extended version of ClassAtomNoDash
B.1.2 Regular Expressions Patterns extends the regular expressions grammar. It extends the original ClassAtomNoDash
ClassAtomNoDash[UnicodeMode] ::
SourceCharacter but not one of \ or ] or -
\ ClassEscape[?UnicodeMode]
with ClassAtomNoDash
ClassAtomNoDash[UnicodeMode, NamedCaptureGroups] ::
SourceCharacter but not one of \ or ] or -
\ ClassEscape[?UnicodeMode, ?NamedCaptureGroups]
\ [lookahead = c]
The extended version has one more parameter (NamedCaptureGroups). All other symbols that make use of ClassAtomNoDash do not define the parameter NamedCaptureGroups for ClassAtomNoDash (all uses of ClassAtomNoDash as a non-terminating symbol are outside Annex B).
If one were to follow the definitions of how the grammar parameters should be understood, then the extended definition of ClassAtomNoDash is
ClassAtomNoDash ::
SourceCharacter but not one of \ or ] or -
\ ClassEscape
\ [lookahead = c]
ClassAtomNoDash_UnicodeMode ::
SourceCharacter but not one of \ or ] or -
\ ClassEscape_UnicodeMode
\ [lookahead = c]
ClassAtomNoDash_NamedCaptureGroups ::
SourceCharacter but not one of \ or ] or -
\ ClassEscape_NamedCaptureGroups
\ [lookahead = c]
ClassAtomNoDash_UnicodeMode_NamedCaptureGroups ::
SourceCharacter but not one of \ or ] or -
\ ClassEscape_UnicodeMode_NamedCaptureGroups
\ [lookahead = c]
given that there are no references in the grammar to ClassAtomNoDash_NamedCaptureGroups nor to ClassAtomNoDash_UnicodeMode_NamedCaptureGroups, then the strictest interpretation of the grammar would be equivalent to the extended version of ClassAtomNoDash being defined as
ClassAtomNoDash[UnicodeMode] ::
SourceCharacter but not one of \ or ] or -
\ ClassEscape[?UnicodeMode, ~NamedCaptureGroups]
\ [lookahead = c]
Is this the correct interpretation of the extended grammar?