diff options
author | Yves Orton <demerphq@gmail.com> | 2016-03-05 22:04:28 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2016-03-06 14:06:08 +0100 |
commit | d5a00e4af6b155495be31a35728b8fef8e671ebe (patch) | |
tree | 562a578c47ebca3abd0f26130e8e9e75cb6702f6 /regcomp.sym | |
parent | 5bd2d46ea3f06ba4e06c713635d5f83a331c4af0 (diff) | |
download | perl-d5a00e4af6b155495be31a35728b8fef8e671ebe.tar.gz |
Unify GOSTART and GOSUB
GOSTART is a special case of GOSUB, we can remove a lot of offset twiddling,
and other special casing by unifying them, at pretty much no cost.
GOSUB has 2 arguments, ARG() and ARG2L(), which are interpreted as
a U32 and an I32 respectively. ARG() holds the "parno" we will recurse
into. ARG2L() holds a signed offset to the relevant start node for the
recursion.
Prior to this patch the argument to GOSUB would always be >=, and unlike
other parts of our logic we would not use 0 to represent "start/end" of
pattern, as GOSTART would be used for "recurse to beginning of pattern",
after this patch we use 0 to represent "start/end", and a lot of
complexity "goes away" along with GOSTART regops.
Diffstat (limited to 'regcomp.sym')
-rw-r--r-- | regcomp.sym | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/regcomp.sym b/regcomp.sym index 8f9861ab6b..ac67955270 100644 --- a/regcomp.sym +++ b/regcomp.sym @@ -190,7 +190,6 @@ AHOCORASICKC TRIE,trie charclass ; Same as AHOCORASICK, but with embedded c #*Regex Subroutines GOSUB GOSUB, num/ofs 2L ; recurse to paren arg1 at (signed) ofs arg2 -GOSTART GOSTART, no ; recurse to start of pattern #*Special conditionals NGROUPP NGROUPP, no-sv 1 ; Whether the group matched. |