This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Can't spawn fresh Perl interpreter with an empty PATH
[perl5.git] / regnodes.h
index 3c3a5d6..d3338c2 100644 (file)
@@ -1,13 +1,13 @@
 /* -*- buffer-read-only: t -*-
    !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
-   This file is built by regcomp.pl from regcomp.sym.
+   This file is built by regen/regcomp.pl from regcomp.sym.
    Any changes made here will be lost!
 */
 
 /* Regops and State definitions */
 
-#define REGNODE_MAX            89
-#define REGMATCH_STATE_MAX     129
+#define REGNODE_MAX            90
+#define REGMATCH_STATE_MAX     130
 
 #define        END                     0       /* 0000 End of program. */
 #define        SUCCEED                 1       /* 0x01 Return from a subroutine, basically. */
@@ -26,7 +26,7 @@
 #define        REG_ANY                 14      /* 0x0e Match any one character (except newline). */
 #define        SANY                    15      /* 0x0f Match any one character. */
 #define        CANY                    16      /* 0x10 Match any one byte. */
-#define        ANYOF                   17      /* 0x11 Match character in (or not in) this class. */
+#define        ANYOF                   17      /* 0x11 Match character in (or not in) this class, folding is native charset for non-utf8. */
 #define        ALNUM                   18      /* 0x12 Match any alphanumeric character */
 #define        ALNUML                  19      /* 0x13 Match any alphanumeric char in locale */
 #define        NALNUM                  20      /* 0x14 Match any non-alphanumeric character */
 #define        DIGITL                  27      /* 0x1b Match any numeric character in locale */
 #define        NDIGIT                  28      /* 0x1c Match any non-numeric character */
 #define        NDIGITL                 29      /* 0x1d Match any non-numeric character in locale */
-#define        CLUMP                   30      /* 0x1e Match any combining character sequence */
+#define        CLUMP                   30      /* 0x1e Match any extended grapheme cluster sequence */
 #define        BRANCH                  31      /* 0x1f Match this alternative, or the next... */
 #define        BACK                    32      /* 0x20 Match "", "next" ptr points backward. */
 #define        EXACT                   33      /* 0x21 Match this string (preceded by length). */
-#define        EXACTF                  34      /* 0x22 Match this string, folded (prec. by length). */
+#define        EXACTF                  34      /* 0x22 Match this string, folded, native charset semantics for non-utf8 (prec. by length). */
 #define        EXACTFL                 35      /* 0x23 Match this string, folded in locale (w/len). */
 #define        NOTHING                 36      /* 0x24 Match empty string. */
 #define        TAIL                    37      /* 0x25 Match empty string. Can jump here from outside. */
@@ -57,7 +57,7 @@
 #define        OPEN                    45      /* 0x2d Mark this point in input as start of */
 #define        CLOSE                   46      /* 0x2e Analogous to OPEN. */
 #define        REF                     47      /* 0x2f Match some already matched string */
-#define        REFF                    48      /* 0x30 Match already matched string, folded */
+#define        REFF                    48      /* 0x30 Match already matched string, folded using native charset semantics for non-utf8 */
 #define        REFFL                   49      /* 0x31 Match already matched string, folded in loc. */
 #define        IFMATCH                 50      /* 0x32 Succeeds if the following matches. */
 #define        UNLESSM                 51      /* 0x33 Fails if the following matches. */
@@ -77,7 +77,7 @@
 #define        GOSUB                   65      /* 0x41 recurse to paren arg1 at (signed) ofs arg2 */
 #define        GOSTART                 66      /* 0x42 recurse to start of pattern */
 #define        NREF                    67      /* 0x43 Match some already matched string */
-#define        NREFF                   68      /* 0x44 Match already matched string, folded */
+#define        NREFF                   68      /* 0x44 Match already matched string, folded using native charset semantics for non-utf8 */
 #define        NREFFL                  69      /* 0x45 Match already matched string, folded in loc. */
 #define        NGROUPP                 70      /* 0x46 Whether the group matched. */
 #define        INSUBP                  71      /* 0x47 Whether we are in a specific recurse. */
@@ -85,7 +85,7 @@
 #define        ENDLIKE                 73      /* 0x49 Used only for the type field of verbs */
 #define        OPFAIL                  74      /* 0x4a Same as (?!) */
 #define        ACCEPT                  75      /* 0x4b Accepts the current matched string. */
-#define        VERB                    76      /* 0x4c    no-sv 1      Used only for the type field of verbs */
+#define        VERB                    76      /* 0x4c Used only for the type field of verbs */
 #define        PRUNE                   77      /* 0x4d Pattern fails at this startpoint if no-backtracking through this */
 #define        MARKPOINT               78      /* 0x4e Push the current location for rollback by cut. */
 #define        SKIP                    79      /* 0x4f On failure skip forward (to the mark) before retrying */
@@ -97,8 +97,9 @@
 #define        NVERTWS                 85      /* 0x55 not vertical whitespace     (Perl 6) */
 #define        HORIZWS                 86      /* 0x56 horizontal whitespace       (Perl 6) */
 #define        NHORIZWS                87      /* 0x57 not horizontal whitespace   (Perl 6) */
-#define        OPTIMIZED               88      /* 0x58 Placeholder for dump. */
-#define        PSEUDO                  89      /* 0x59 Pseudo opcode for internal use. */
+#define        FOLDCHAR                88      /* 0x58 codepoint with tricky case folding properties. */
+#define        OPTIMIZED               89      /* 0x59 Placeholder for dump. */
+#define        PSEUDO                  90      /* 0x5a Pseudo opcode for internal use. */
        /* ------------ States ------------- */
 #define        TRIE_next               (REGNODE_MAX + 1)       /* state for TRIE */
 #define        TRIE_next_fail          (REGNODE_MAX + 2)       /* state for TRIE */
@@ -235,6 +236,7 @@ EXTCONST U8 PL_regkind[] = {
        NVERTWS,        /* NVERTWS                */
        HORIZWS,        /* HORIZWS                */
        NHORIZWS,       /* NHORIZWS               */
+       FOLDCHAR,       /* FOLDCHAR               */
        NOTHING,        /* OPTIMIZED              */
        PSEUDO,         /* PSEUDO                 */
        /* ------------ States ------------- */
@@ -361,7 +363,7 @@ static const U8 regarglen[] = {
        0,                                      /* ENDLIKE      */
        0,                                      /* OPFAIL       */
        EXTRA_SIZE(struct regnode_1),           /* ACCEPT       */
-       0,                                      /* VERB         */
+       EXTRA_SIZE(struct regnode_1),           /* VERB         */
        EXTRA_SIZE(struct regnode_1),           /* PRUNE        */
        EXTRA_SIZE(struct regnode_1),           /* MARKPOINT    */
        EXTRA_SIZE(struct regnode_1),           /* SKIP         */
@@ -373,6 +375,7 @@ static const U8 regarglen[] = {
        0,                                      /* NVERTWS      */
        0,                                      /* HORIZWS      */
        0,                                      /* NHORIZWS     */
+       EXTRA_SIZE(struct regnode_1),           /* FOLDCHAR     */
        0,                                      /* OPTIMIZED    */
        0,                                      /* PSEUDO       */
 };
@@ -468,6 +471,7 @@ static const char reg_off_by_arg[] = {
        0,      /* NVERTWS      */
        0,      /* HORIZWS      */
        0,      /* NHORIZWS     */
+       0,      /* FOLDCHAR     */
        0,      /* OPTIMIZED    */
        0,      /* PSEUDO       */
 };
@@ -568,8 +572,9 @@ EXTCONST char * const PL_reg_name[] = {
        "NVERTWS",                      /* 0x55 */
        "HORIZWS",                      /* 0x56 */
        "NHORIZWS",                     /* 0x57 */
-       "OPTIMIZED",                    /* 0x58 */
-       "PSEUDO",                       /* 0x59 */
+       "FOLDCHAR",                     /* 0x58 */
+       "OPTIMIZED",                    /* 0x59 */
+       "PSEUDO",                       /* 0x5a */
        /* ------------ States ------------- */
        "TRIE_next",                    /* REGNODE_MAX +0x01 */
        "TRIE_next_fail",               /* REGNODE_MAX +0x02 */
@@ -614,4 +619,90 @@ EXTCONST char * const PL_reg_name[] = {
 };
 #endif /* DOINIT */
 
+/* PL_reg_extflags_name[] - Opcode/state names in string form, for debugging */
+
+#ifndef DOINIT
+EXTCONST char * PL_reg_extflags_name[];
+#else
+EXTCONST char * const PL_reg_extflags_name[] = {
+       /* Bits in extflags defined: 11111111111111111111111001111111 */
+       "MULTILINE",        /* 0x00000001 */
+       "SINGLELINE",       /* 0x00000002 */
+       "FOLD",             /* 0x00000004 */
+       "EXTENDED",         /* 0x00000008 */
+       "KEEPCOPY",         /* 0x00000010 */
+       "LOCALE",           /* 0x00000020 */
+       "UNICODE",          /* 0x00000040 */
+       "UNUSED_BIT_7",     /* 0x00000080 */
+       "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 */
+       "EVAL_SEEN",        /* 0x00010000 */
+       "CANY_SEEN",        /* 0x00020000 */
+       "NOSCAN",           /* 0x00040000 */
+       "CHECK_ALL",        /* 0x00080000 */
+       "MATCH_UTF8",       /* 0x00100000 */
+       "USE_INTUIT_NOML",  /* 0x00200000 */
+       "USE_INTUIT_ML",    /* 0x00400000 */
+       "INTUIT_TAIL",      /* 0x00800000 */
+       "SPLIT",            /* 0x01000000 */
+       "COPY_DONE",        /* 0x02000000 */
+       "TAINTED_SEEN",     /* 0x04000000 */
+       "TAINTED",          /* 0x08000000 */
+       "START_ONLY",       /* 0x10000000 */
+       "SKIPWHITE",        /* 0x20000000 */
+       "WHITE",            /* 0x40000000 */
+       "NULL",             /* 0x80000000 */
+};
+#endif /* DOINIT */
+
+/* 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)))
+
+#ifndef DOINIT
+EXTCONST U8 PL_varies[] __attribute__deprecated__;
+#else
+EXTCONST U8 PL_varies[] __attribute__deprecated__ = {
+    CLUMP, BRANCH, BACK, STAR, PLUS, CURLY, CURLYN, CURLYM, CURLYX, WHILEM,
+    REF, REFF, REFFL, SUSPEND, IFTHEN, BRANCHJ, NREF, NREFF, NREFFL,
+    0
+};
+#endif /* DOINIT */
+
+#ifndef DOINIT
+EXTCONST U8 PL_varies_bitmask[];
+#else
+EXTCONST U8 PL_varies_bitmask[] = {
+    0x00, 0x00, 0x00, 0xC0, 0xC1, 0x9F, 0x33, 0x01, 0x38, 0x00, 0x00, 0x00
+};
+#endif /* DOINIT */
+
+/* The following always have a length of 1. U8 we can do strchr() on it. */
+/* (Note that length 1 means "one character" under UTF8, not "one octet".) */
+#define REGNODE_SIMPLE(node) (PL_simple_bitmask[(node) >> 3] & (1 << ((node) & 7)))
+
+#ifndef DOINIT
+EXTCONST U8 PL_simple[] __attribute__deprecated__;
+#else
+EXTCONST U8 PL_simple[] __attribute__deprecated__ = {
+    REG_ANY, SANY, CANY, ANYOF, ALNUM, ALNUML, NALNUM, NALNUML, SPACE,
+    SPACEL, NSPACE, NSPACEL, DIGIT, NDIGIT, VERTWS, NVERTWS, HORIZWS,
+    NHORIZWS,
+    0
+};
+#endif /* DOINIT */
+
+#ifndef DOINIT
+EXTCONST U8 PL_simple_bitmask[];
+#else
+EXTCONST U8 PL_simple_bitmask[] = {
+    0x00, 0xC0, 0xFF, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00
+};
+#endif /* DOINIT */
+
 /* ex: set ro: */