Backward running version look-behinds

Waldemar Horwat waldemar at google.com
Wed Dec 30 22:56:56 UTC 2015


On 12/11/2015 13:16, Nozomu Katō wrote:
> I wonder if the person who wrote the spec for RegExp is on this list. I
> would like to ask one question: Was there any reason why the following
> steps were defined in the present order:
>
> 21.2.2.4 Alternative
>    The production Alternative :: Alternative Term evaluates as follows:
>    1. Evaluate Alternative to obtain a Matcher m1.
>    2. Evaluate Term to obtain a Matcher m2.
>
> instead of:
>
>    The production Alternative :: Term Alternative evaluates as follows:
>    1. Evaluate Term to obtain a Matcher m1.
>    2. Evaluate Alternative to obtain a Matcher m2.
>
> or, was it a matter of preference? If any side effect I am missing
> exists in the latter order, I need to reconsider or abandon my compact
> version.

Those appear to have equivalent behavior.  I just picked one when writing the RegExp spec.

     Waldemar



More information about the es-discuss mailing list