From: Karl Williamson Date: Sun, 12 Aug 2012 17:50:54 +0000 (-0600) Subject: regcomp.sym: Change regkind for NPOSIX regnodes X-Git-Tag: v5.17.6~18^2~15 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/9e84774b2a68a51af5e246f365059d61ebe86fb0 regcomp.sym: Change regkind for NPOSIX regnodes It turns out that it is more convenient for the complement of a node to have a regkind that is also the complement of a node. This creates slight inconveniences that are included in this patch, but will help further patches. --- diff --git a/regcomp.c b/regcomp.c index 3a95ea9..57db80b 100644 --- a/regcomp.c +++ b/regcomp.c @@ -12585,7 +12585,7 @@ parseit: ret = reg_node(pRExC_state, op); - if (PL_regkind[op] == POSIXD) { + if (PL_regkind[op] == POSIXD || PL_regkind[op] == NPOSIXD) { if (! SIZE_ONLY) { FLAGS(ret) = arg; } @@ -14097,7 +14097,7 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o) Perl_sv_catpvf(aTHX_ sv, "%s]", PL_colors[1]); } - else if (k == POSIXD) { + else if (k == POSIXD || k == NPOSIXD) { U8 index = FLAGS(o) * 2; if (index > (sizeof(anyofs) / sizeof(anyofs[0]))) { Perl_sv_catpvf(aTHX_ sv, "[illegal type=%d])", index); diff --git a/regcomp.sym b/regcomp.sym index 3b4db9c..eb8ba46 100644 --- a/regcomp.sym +++ b/regcomp.sym @@ -89,10 +89,10 @@ POSIXD POSIXD, none 0 S ; currently unused except as a placeholder POSIXL POSIXD, none 0 S ; currently unused except as a placeholder POSIXU POSIXD, none 0 S ; currently unused except as a placeholder POSIXA POSIXD, none 0 S ; Some [[:class:]] under /a; the FLAGS field gives which one -NPOSIXD POSIXD, none 0 S ; currently unused except as a placeholder -NPOSIXL POSIXD, none 0 S ; currently unused except as a placeholder -NPOSIXU POSIXD, none 0 S ; currently unused except as a placeholder -NPOSIXA POSIXD, none 0 S ; complement of POSIXA, [[:^class:]] +NPOSIXD NPOSIXD, none 0 S ; currently unused except as a placeholder +NPOSIXL NPOSIXD, none 0 S ; currently unused except as a placeholder +NPOSIXU NPOSIXD, none 0 S ; currently unused except as a placeholder +NPOSIXA NPOSIXD, none 0 S ; complement of POSIXA, [[:^class:]] # End of order is important (within groups) CLUMP CLUMP, no 0 V ; Match any extended grapheme cluster sequence diff --git a/regnodes.h b/regnodes.h index b8278cc..2024d15 100644 --- a/regnodes.h +++ b/regnodes.h @@ -229,10 +229,10 @@ EXTCONST U8 PL_regkind[] = { POSIXD, /* POSIXL */ POSIXD, /* POSIXU */ POSIXD, /* POSIXA */ - POSIXD, /* NPOSIXD */ - POSIXD, /* NPOSIXL */ - POSIXD, /* NPOSIXU */ - POSIXD, /* NPOSIXA */ + NPOSIXD, /* NPOSIXD */ + NPOSIXD, /* NPOSIXL */ + NPOSIXD, /* NPOSIXU */ + NPOSIXD, /* NPOSIXA */ CLUMP, /* CLUMP */ BRANCH, /* BRANCH */ BACK, /* BACK */