From d5a00e4af6b155495be31a35728b8fef8e671ebe Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Sat, 5 Mar 2016 22:04:28 +0100 Subject: 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. --- regcomp.sym | 1 - 1 file changed, 1 deletion(-) (limited to 'regcomp.sym') 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. -- cgit v1.2.1