Branch: refs/heads/yves/optimistic_eval
  Home:   https://github.com/Perl/perl5
  Commit: dc030d62b92c1ddba368b824fcea7c88c178cb35
      
https://github.com/Perl/perl5/commit/dc030d62b92c1ddba368b824fcea7c88c178cb35
  Author: Yves Orton <demer...@gmail.com>
  Date:   2023-01-18 (Wed, 18 Jan 2023)

  Changed paths:
    M pod/perldelta.pod
    M pod/perlre.pod
    M regcomp.c
    M regcomp.h
    M regcomp_debug.c
    M regcomp_internal.h
    M regcomp_study.c
    M regexec.c
    M regnodes.h
    M t/re/pat_re_eval.t
    M t/re/pat_rt_report.t
    M toke.c

  Log Message:
  -----------
  regcomp.c - add optimistic eval (*{ ... }) and (**{ ... })

This adds (*{ ... }) and (**{ ... }) as equivalents to (?{ ... }) and
(??{ ... }). The only difference being that the star variants are
"optimisitic" and are defined to never disable optimisations. This is
especially relevant now that use of (?{ ... }) prevents important
optimisations anywhere in the pattern, instead of the older and inconsistent
rules where it only affected the parts that contained the EVAL.

It is also very useful for injecting debugging style expressions to the
pattern to understand what the regex engine is actually doing. The older
style (?{ ... }) variants would change the regex engines behavior, meaning
this was not as effective a tool as it could have been.

Similarly it is now possible to test that a given regex optimisation
works correctly using (*{ ... }), which was not possible with (?{ ... }).


Reply via email to