mirror of
https://github.com/ruby/ruby.git
synced 2025-09-17 17:43:59 +02:00
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
This commit is contained in:
parent
4090bd7b51
commit
16f70c0e89
5 changed files with 40 additions and 8 deletions
13
regcomp.c
13
regcomp.c
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue