X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/65aa4ca74a9ca9deb18dd3f64021e628289096c4..736c79db2485068b77cfe34cb6c0aa3e4dd65187:/regnodes.h diff --git a/regnodes.h b/regnodes.h index 4754921..43ec6819 100644 --- a/regnodes.h +++ b/regnodes.h @@ -18,14 +18,14 @@ #define EOL 6 /* 0x06 Match "" at end of line. */ #define MEOL 7 /* 0x07 Same, assuming multiline. */ #define SEOL 8 /* 0x08 Same, assuming singleline. */ -#define BOUND 9 /* 0x09 Match "" at any word boundary using native charset semantics for non-utf8 */ +#define BOUND 9 /* 0x09 Match "" at any word boundary using native charset rules for non-utf8 */ #define BOUNDL 10 /* 0x0a Match "" at any locale word boundary */ -#define BOUNDU 11 /* 0x0b Match "" at any word boundary using Unicode semantics */ -#define BOUNDA 12 /* 0x0c Match "" at any word boundary using ASCII semantics */ -#define NBOUND 13 /* 0x0d Match "" at any word non-boundary using native charset semantics for non-utf8 */ +#define BOUNDU 11 /* 0x0b Match "" at any word boundary using Unicode rules */ +#define BOUNDA 12 /* 0x0c Match "" at any word boundary using ASCII rules */ +#define NBOUND 13 /* 0x0d Match "" at any word non-boundary using native charset rules for non-utf8 */ #define NBOUNDL 14 /* 0x0e Match "" at any locale word non-boundary */ -#define NBOUNDU 15 /* 0x0f Match "" at any word non-boundary using Unicode semantics */ -#define NBOUNDA 16 /* 0x10 Match "" at any word non-boundary using ASCII semantics */ +#define NBOUNDU 15 /* 0x0f Match "" at any word non-boundary using Unicode rules */ +#define NBOUNDA 16 /* 0x10 Match "" at any word non-boundary using ASCII rules */ #define GPOS 17 /* 0x11 Matches where last m//g left off. */ #define REG_ANY 18 /* 0x12 Match any one character (except newline). */ #define SANY 19 /* 0x13 Match any one character. */ @@ -48,7 +48,7 @@ #define EXACTFU 36 /* 0x24 Match this string (folded iff in UTF-8, length in folding doesn't change if not in UTF-8) using /iu rules (w/len). */ #define EXACTFA 37 /* 0x25 Match this string (not guaranteed to be folded) using /iaa rules (w/len). */ #define EXACTFU_SS 38 /* 0x26 Match this string (folded iff in UTF-8, length in folding may change even if not in UTF-8) using /iu rules (w/len). */ -#define EXACTFU_TRICKYFOLD 39 /* 0x27 Match this folded UTF-8 string using /iu rules */ +#define EXACTFA_NO_TRIE 39 /* 0x27 Match this string (which is not trie-able; not guaranteed to be folded) using /iaa rules (w/len). */ #define NOTHING 40 /* 0x28 Match empty string. */ #define TAIL 41 /* 0x29 Match empty string. Can jump here from outside. */ #define STAR 42 /* 0x2a Match this (simple) thing 0 or more times. */ @@ -61,15 +61,15 @@ #define OPEN 49 /* 0x31 Mark this point in input as start of #n. */ #define CLOSE 50 /* 0x32 Analogous to OPEN. */ #define REF 51 /* 0x33 Match some already matched string */ -#define REFF 52 /* 0x34 Match already matched string, folded using native charset semantics for non-utf8 */ +#define REFF 52 /* 0x34 Match already matched string, folded using native charset rules for non-utf8 */ #define REFFL 53 /* 0x35 Match already matched string, folded in loc. */ -#define REFFU 54 /* 0x36 Match already matched string, folded using unicode semantics for non-utf8 */ -#define REFFA 55 /* 0x37 Match already matched string, folded using unicode semantics for non-utf8, no mixing ASCII, non-ASCII */ +#define REFFU 54 /* 0x36 Match already matched string, folded using unicode rules for non-utf8 */ +#define REFFA 55 /* 0x37 Match already matched string, folded using unicode rules for non-utf8, no mixing ASCII, non-ASCII */ #define NREF 56 /* 0x38 Match some already matched string */ -#define NREFF 57 /* 0x39 Match already matched string, folded using native charset semantics for non-utf8 */ +#define NREFF 57 /* 0x39 Match already matched string, folded using native charset rules for non-utf8 */ #define NREFFL 58 /* 0x3a Match already matched string, folded in loc. */ -#define NREFFU 59 /* 0x3b Match already matched string, folded using unicode semantics for non-utf8 */ -#define NREFFA 60 /* 0x3c Match already matched string, folded using unicode semantics for non-utf8, no mixing ASCII, non-ASCII */ +#define NREFFU 59 /* 0x3b Match already matched string, folded using unicode rules for non-utf8 */ +#define NREFFA 60 /* 0x3c Match already matched string, folded using unicode rules for non-utf8, no mixing ASCII, non-ASCII */ #define IFMATCH 61 /* 0x3d Succeeds if the following matches. */ #define UNLESSM 62 /* 0x3e Fails if the following matches. */ #define SUSPEND 63 /* 0x3f "Independent" sub-RE. */ @@ -190,7 +190,7 @@ EXTCONST U8 PL_regkind[] = { EXACT, /* EXACTFU */ EXACT, /* EXACTFA */ EXACT, /* EXACTFU_SS */ - EXACT, /* EXACTFU_TRICKYFOLD */ + EXACT, /* EXACTFA_NO_TRIE */ NOTHING, /* NOTHING */ NOTHING, /* TAIL */ STAR, /* STAR */ @@ -332,7 +332,7 @@ static const U8 regarglen[] = { 0, /* EXACTFU */ 0, /* EXACTFA */ 0, /* EXACTFU_SS */ - 0, /* EXACTFU_TRICKYFOLD */ + 0, /* EXACTFA_NO_TRIE */ 0, /* NOTHING */ 0, /* TAIL */ 0, /* STAR */ @@ -431,7 +431,7 @@ static const char reg_off_by_arg[] = { 0, /* EXACTFU */ 0, /* EXACTFA */ 0, /* EXACTFU_SS */ - 0, /* EXACTFU_TRICKYFOLD */ + 0, /* EXACTFA_NO_TRIE */ 0, /* NOTHING */ 0, /* TAIL */ 0, /* STAR */ @@ -535,7 +535,7 @@ EXTCONST char * const PL_reg_name[] = { "EXACTFU", /* 0x24 */ "EXACTFA", /* 0x25 */ "EXACTFU_SS", /* 0x26 */ - "EXACTFU_TRICKYFOLD", /* 0x27 */ + "EXACTFA_NO_TRIE", /* 0x27 */ "NOTHING", /* 0x28 */ "TAIL", /* 0x29 */ "STAR", /* 0x2a */ @@ -640,42 +640,73 @@ EXTCONST char * const PL_reg_name[] = { EXTCONST char * PL_reg_extflags_name[]; #else EXTCONST char * const PL_reg_extflags_name[] = { - /* Bits in extflags defined: 11011111111111111111111011111111 */ + /* Bits in extflags defined: 11111110111111111111111111111111 */ "MULTILINE", /* 0x00000001 */ "SINGLELINE", /* 0x00000002 */ "FOLD", /* 0x00000004 */ "EXTENDED", /* 0x00000008 */ "KEEPCOPY", /* 0x00000010 */ - "CHARSET", /* 0x000000e0 */ - "CHARSET", /* 0x000000e0 */ - "CHARSET", /* 0x000000e0 */ - "UNUSED_BIT_8", /* 0x00000100 */ - "ANCH_BOL", /* 0x00000200 */ - "ANCH_MBOL", /* 0x00000400 */ - "ANCH_SBOL", /* 0x00000800 */ - "ANCH_GPOS", /* 0x00001000 */ - "GPOS_SEEN", /* 0x00002000 */ - "GPOS_FLOAT", /* 0x00004000 */ - "LOOKBEHIND_SEEN", /* 0x00008000 */ + "CHARSET0", /* 0x00000020 : "CHARSET" - 0x000000e0 */ + "CHARSET1", /* 0x00000040 : "CHARSET" - 0x000000e0 */ + "CHARSET2", /* 0x00000080 : "CHARSET" - 0x000000e0 */ + "SPLIT", /* 0x00000100 */ + "IS_ANCHORED", /* 0x00000200 */ + "UNUSED1", /* 0x00000400 */ + "UNUSED2", /* 0x00000800 */ + "UNUSED3", /* 0x00001000 */ + "UNUSED4", /* 0x00002000 */ + "UNUSED5", /* 0x00004000 */ + "NO_INPLACE_SUBST", /* 0x00008000 */ "EVAL_SEEN", /* 0x00010000 */ - "CANY_SEEN", /* 0x00020000 */ - "NOSCAN", /* 0x00040000 */ + "UNUSED8", /* 0x00020000 */ + "UNBOUNDED_QUANTIFIER_SEEN",/* 0x00040000 */ "CHECK_ALL", /* 0x00080000 */ "MATCH_UTF8", /* 0x00100000 */ "USE_INTUIT_NOML", /* 0x00200000 */ "USE_INTUIT_ML", /* 0x00400000 */ "INTUIT_TAIL", /* 0x00800000 */ - "MODIFIES_VARS", /* 0x01000000 */ + "UNUSED_BIT_24", /* 0x01000000 */ "COPY_DONE", /* 0x02000000 */ "TAINTED_SEEN", /* 0x04000000 */ "TAINTED", /* 0x08000000 */ "START_ONLY", /* 0x10000000 */ - "UNUSED_BIT_29", /* 0x20000000 */ + "SKIPWHITE", /* 0x20000000 */ "WHITE", /* 0x40000000 */ "NULL", /* 0x80000000 */ }; #endif /* DOINIT */ +#ifdef DEBUGGING +# define REG_EXTFLAGS_NAME_SIZE 32 +#endif + +/* PL_reg_intflags_name[] - Opcode/state names in string form, for debugging */ + +#ifndef DOINIT +EXTCONST char * PL_reg_intflags_name[]; +#else +EXTCONST char * const PL_reg_intflags_name[] = { + "SKIP", /* 0x00000001 - PREGf_SKIP */ + "IMPLICIT", /* 0x00000002 - PREGf_IMPLICIT - Converted .* to ^.* */ + "NAUGHTY", /* 0x00000004 - PREGf_NAUGHTY - how exponential is this pattern? */ + "VERBARG_SEEN", /* 0x00000008 - PREGf_VERBARG_SEEN */ + "CUTGROUP_SEEN", /* 0x00000010 - PREGf_CUTGROUP_SEEN */ + "USE_RE_EVAL", /* 0x00000020 - PREGf_USE_RE_EVAL - compiled with "use re 'eval'" */ + "NOSCAN", /* 0x00000040 - PREGf_NOSCAN */ + "CANY_SEEN", /* 0x00000080 - PREGf_CANY_SEEN */ + "GPOS_SEEN", /* 0x00000100 - PREGf_GPOS_SEEN */ + "GPOS_FLOAT", /* 0x00000200 - PREGf_GPOS_FLOAT */ + "ANCH_BOL", /* 0x00000400 - PREGf_ANCH_BOL */ + "ANCH_MBOL", /* 0x00000800 - PREGf_ANCH_MBOL */ + "ANCH_SBOL", /* 0x00001000 - PREGf_ANCH_SBOL */ + "ANCH_GPOS", /* 0x00002000 - PREGf_ANCH_GPOS */ +}; +#endif /* DOINIT */ + +#ifdef DEBUGGING +# define REG_INTFLAGS_NAME_SIZE 14 +#endif + /* The following have no fixed length. U8 so we can do strchr() on it. */ #define REGNODE_VARIES(node) (PL_varies_bitmask[(node) >> 3] & (1 << ((node) & 7)))