Skip to content

Commit

Permalink
Add a note that implementations do not have to use regexps to match.
Browse files Browse the repository at this point in the history
  • Loading branch information
wanderview committed Aug 12, 2021
1 parent 68b66a0 commit ac79186
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ A [=component=] has an associated <dfn for=component>group name list</dfn>, a [=
1. Let |part list| be the result of running [=parse a pattern string=] given |input|, |options|, and |encoding callback|.
1. Let (|regular expression string|, |name list|) be the result of running [=generate a regular expression and name list=] given |part list| and |options|.
1. Let |regular expression| be [$RegExpCreate$](|regular expression string|, "`u`"). If this throws an exception, catch it, and throw a {{TypeError}}.
<p class="note allow-2119">The specification uses regular expressions to perform all matching, but this is not required. Implementations are free to perform matching directly against the [=/part list=] when possible; e.g. when there are no custom regexp matching groups. If there are custom regular expressions, however, its important that they should be immediately evaluated in [=compile a component=] algorithm so an error can be thrown if they are invalid.
1. Let |pattern string| be the result of running [=generate a pattern string=] given |part list| and |options|.
1. Return a new [=component=] whose [=component/pattern string=] is |pattern string|, [=component/regular expression=] is |regular expression|, and [=component/group name list=] is |name list|.
</div>
Expand Down

0 comments on commit ac79186

Please sign in to comment.