I am glad to see a spec for .NET-style look-behinds. I am hoping it is
considered by those who are familiar with the ECMAScript specification.

As a third option, introducing \K being available in recent versions of
Perl might be worth considering. This expression excludes what the
preceding expressions matched from $&. So, this can be used as a
substitution for a variable-length positive look-behind.
http://perldoc.perl.org/perlre.html#(%3f%3c%3dpattern)-%5cK

The only unresolved problem with this is that a negative corresponding
version of it has not been known yet. If we can find it out, these may
become the most simple and efficient option.

Nozomu


On Tue, 24 Nov 2015 18:35:12 +0100, Claude Pache wrote:
> 
>> Le 20 nov. 2015 à 15:41, Nozomu Katō a écrit :
>>
>> I was expecting that ES6 would come with look-behinds, because a
>> proposal had been put at:
>> http://web.archive.org/web/20121114071428/http://wiki.ecmascript.org/doku.php?id=harmony:proposals
>>
>> However, ES6 does not support them. I noticed that the link to the
>> proposal had been struck-through:
>> http://web.archive.org/web/20150812143714/http://wiki.ecmascript.org/doku.php?id=harmony:proposals
>>
>> I wondered what was a problem. I did research to know the situation
>> about look-behinds, and I found this post:
>> https://mail.mozilla.org/pipermail/es-discuss/2013-October/033911.html
>>
>> I realised that a spec needed to be written by someone, but "someone"
>> had not appeared yet. Thus, I wrote a spec, subscribed to es-discuss,
>> and posted the spec. What made me decide to post that spec was this
>> post and thread.
>>
>> But now, it turns out that look-behinds similar to the proposal that has
>> been struck-through have been implemented experimentally in Chromium and
>> Gecko. I am confused about the ongoing situation.
>>
>> I am NOT an objector against .NET-compatible look-behinds. But I wonder
>> if there is someone who writes a spec for them. I have no idea how the
>> behaviours of look-behinds based on the .NET implementation are
>> described in the language used by the ECMAScript spec. Introducing an
>> internal direction switch might be a relatively simple way, but I have
>> no concrete idea even about it.
>>
>> Nozomu
> 
> 
> I've amended the spec in order to add .NET-style lookbehinds. It proved to be 
> indeed relatively simple, once you get how it works. Here is the result (with 
> diffs):
> 
> http://claudepache.github.io/ecma262/#sec-pattern 
> <http://claudepache.github.io/ecma262/#sec-pattern>
> 
> The most difficult part was to manage to output the token `<!` in ecmarkdown 
> :-P
> 
> —Claude
> 
> 
> 


_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to