diff options
author | Yves Orton <demerphq@gmail.com> | 2007-01-10 21:33:39 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-01-11 14:47:01 +0000 |
commit | ee9b8eaedac8053a01cc9281ada34dd182a8f7d0 (patch) | |
tree | 129df8e187e17fb664051b0f7f9a1b55d46fcecd /regnodes.h | |
parent | b4390064818aaae08b8f53f740ea62f7dd8517a1 (diff) | |
download | perl-ee9b8eaedac8053a01cc9281ada34dd182a8f7d0.tar.gz |
Add Regexp::Keep \K functionality to regex engine as well as add \v and \V, cleanup and more docs for regatom()
Message-ID: <9b18b3110701101133i46dc5fd0p1476a0f1dd1e9c5a@mail.gmail.com>
(plus POD nits by Merijn and myself)
p4raw-id: //depot/perl@29756
Diffstat (limited to 'regnodes.h')
-rw-r--r-- | regnodes.h | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/regnodes.h b/regnodes.h index bbb49db983..8727a01392 100644 --- a/regnodes.h +++ b/regnodes.h @@ -6,8 +6,8 @@ /* Regops and State definitions */ -#define REGNODE_MAX 83 -#define REGMATCH_STATE_MAX 121 +#define REGNODE_MAX 84 +#define REGMATCH_STATE_MAX 124 #define END 0 /* 0000 End of program. */ #define SUCCEED 1 /* 0x01 Return from a subroutine, basically. */ @@ -91,8 +91,9 @@ #define SKIP 79 /* 0x4f On failure skip forward (to the mark) before retrying */ #define COMMIT 80 /* 0x50 Pattern fails outright if backtracking through this */ #define CUTGROUP 81 /* 0x51 On failure go to the next alternation in the group */ -#define OPTIMIZED 82 /* 0x52 Placeholder for dump. */ -#define PSEUDO 83 /* 0x53 Pseudo opcode for internal use. */ +#define KEEPS 82 /* 0x52 $& begins here. */ +#define OPTIMIZED 83 /* 0x53 Placeholder for dump. */ +#define PSEUDO 84 /* 0x54 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 */ @@ -132,6 +133,8 @@ #define SKIP_next_fail (REGNODE_MAX + 36) /* state for SKIP */ #define CUTGROUP_next (REGNODE_MAX + 37) /* state for CUTGROUP */ #define CUTGROUP_next_fail (REGNODE_MAX + 38) /* state for CUTGROUP */ +#define KEEPS_next (REGNODE_MAX + 39) /* state for KEEPS */ +#define KEEPS_next_fail (REGNODE_MAX + 40) /* state for KEEPS */ /* PL_regkind[] What type of regop or state is this. */ @@ -206,9 +209,9 @@ EXTCONST U8 PL_regkind[] = { TRIE, /* AHOCORASICKC */ GOSUB, /* GOSUB */ GOSTART, /* GOSTART */ - NREF, /* NREF */ - NREF, /* NREFF */ - NREF, /* NREFFL */ + REF, /* NREF */ + REF, /* NREFF */ + REF, /* NREFFL */ NGROUPP, /* NGROUPP */ INSUBP, /* INSUBP */ DEFINEP, /* DEFINEP */ @@ -221,6 +224,7 @@ EXTCONST U8 PL_regkind[] = { VERB, /* SKIP */ VERB, /* COMMIT */ VERB, /* CUTGROUP */ + KEEPS, /* KEEPS */ NOTHING, /* OPTIMIZED */ PSEUDO, /* PSEUDO */ /* ------------ States ------------- */ @@ -262,6 +266,8 @@ EXTCONST U8 PL_regkind[] = { SKIP, /* SKIP_next_fail */ CUTGROUP, /* CUTGROUP_next */ CUTGROUP, /* CUTGROUP_next_fail */ + KEEPS, /* KEEPS_next */ + KEEPS, /* KEEPS_next_fail */ }; #endif @@ -351,6 +357,7 @@ static const U8 regarglen[] = { EXTRA_SIZE(struct regnode_1), /* SKIP */ EXTRA_SIZE(struct regnode_1), /* COMMIT */ EXTRA_SIZE(struct regnode_1), /* CUTGROUP */ + 0, /* KEEPS */ 0, /* OPTIMIZED */ 0, /* PSEUDO */ }; @@ -440,6 +447,7 @@ static const char reg_off_by_arg[] = { 0, /* SKIP */ 0, /* COMMIT */ 0, /* CUTGROUP */ + 0, /* KEEPS */ 0, /* OPTIMIZED */ 0, /* PSEUDO */ }; @@ -530,8 +538,9 @@ const char * reg_name[] = { "SKIP", /* 0x4f */ "COMMIT", /* 0x50 */ "CUTGROUP", /* 0x51 */ - "OPTIMIZED", /* 0x52 */ - "PSEUDO", /* 0x53 */ + "KEEPS", /* 0x52 */ + "OPTIMIZED", /* 0x53 */ + "PSEUDO", /* 0x54 */ /* ------------ States ------------- */ "TRIE_next", /* REGNODE_MAX +0x01 */ "TRIE_next_fail", /* REGNODE_MAX +0x02 */ @@ -571,6 +580,8 @@ const char * reg_name[] = { "SKIP_next_fail", /* REGNODE_MAX +0x24 */ "CUTGROUP_next", /* REGNODE_MAX +0x25 */ "CUTGROUP_next_fail", /* REGNODE_MAX +0x26 */ + "KEEPS_next", /* REGNODE_MAX +0x27 */ + "KEEPS_next_fail", /* REGNODE_MAX +0x28 */ }; #endif /* DEBUGGING */ #else |