diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-04 16:30:19 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-04 16:30:19 +0000 |
commit | 16f70c0e89f50e034a2a5d5cf2ec3d5127d34d6c (patch) | |
tree | 5fdc584603cbfeaad47556e966de2085de826553 /regcomp.c | |
parent | 4090bd7b510cd745ffd88943a87bfb6e94537ead (diff) |
merge revision(s) 41764,41765,41767: [Backport #8583]
* regcomp.c (): Merge Onigmo 5.13.5 23b523076d6f1161.
https://bugs.ruby-lang.org/issues/8583
* [bug] (thanks Akinori MUSHA and Ippei Obayashi)
Fix a renumbering bug in condition regexp with a named
capture. [Bug #8583]
* [spec] (thanks Akinori MUSHA)
Allow ENCLOSE_OPTION in look-behind.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@41780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1943,7 +1943,12 @@ renumber_by_map(Node* node, GroupNumRemap* map) r = renumber_by_map(NQTFR(node)->target, map); break; case NT_ENCLOSE: - r = renumber_by_map(NENCLOSE(node)->target, map); + { + EncloseNode* en = NENCLOSE(node); + if (en->type == ENCLOSE_CONDITION) + en->regnum = map[en->regnum].new_val; + r = renumber_by_map(en->target, map); + } break; case NT_BREF: @@ -4090,8 +4095,8 @@ restart: ( BIT_NT_LIST | BIT_NT_ALT | BIT_NT_STR | BIT_NT_CCLASS | BIT_NT_CTYPE | \ BIT_NT_CANY | BIT_NT_ANCHOR | BIT_NT_ENCLOSE | BIT_NT_QTFR | BIT_NT_CALL ) -#define ALLOWED_ENCLOSE_IN_LB ( ENCLOSE_MEMORY ) -#define ALLOWED_ENCLOSE_IN_LB_NOT 0 +#define ALLOWED_ENCLOSE_IN_LB ( ENCLOSE_MEMORY | ENCLOSE_OPTION ) +#define ALLOWED_ENCLOSE_IN_LB_NOT ENCLOSE_OPTION #define ALLOWED_ANCHOR_IN_LB \ ( ANCHOR_LOOK_BEHIND | ANCHOR_LOOK_BEHIND_NOT | ANCHOR_BEGIN_LINE | \ @@ -6646,7 +6651,7 @@ print_indent_tree(FILE* f, Node* node, int indent) fprintf(f, "<enclose:%"PRIxPTR"> ", (intptr_t)node); switch (NENCLOSE(node)->type) { case ENCLOSE_OPTION: - fprintf(f, "option:%d\n", NENCLOSE(node)->option); + fprintf(f, "option:%d", NENCLOSE(node)->option); break; case ENCLOSE_MEMORY: fprintf(f, "memory:%d", NENCLOSE(node)->regnum); |