diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-28 09:57:47 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-28 09:57:47 +0000 |
commit | ee09f19fdbf047a31ec1c85e6f53ea4a67ded48c (patch) | |
tree | 11333e1be6057ca1395d6e10a87e5e090a84e1da /regcomp.c | |
parent | 809615987141a9faab189b3b9b74b0f9bd8a2508 (diff) |
* regcomp.c (optimize_node_left, set_optimize_info_from_tree): right
handling for look behind anchor.
* regexec.c (onig_search): ditto.
[Backport #8076]
this patch is derived from Onigmo base tree.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@39983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -4735,6 +4735,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env) case ANCHOR_END_BUF: case ANCHOR_SEMI_END_BUF: case ANCHOR_END_LINE: + case ANCHOR_LOOK_BEHIND: /* just for (?<=x).* */ add_opt_anc_info(&opt->anc, NANCHOR(node)->type); break; @@ -4758,7 +4759,6 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env) break; case ANCHOR_PREC_READ_NOT: - case ANCHOR_LOOK_BEHIND: /* Sorry, I can't make use of it. */ case ANCHOR_LOOK_BEHIND_NOT: break; } @@ -5010,7 +5010,8 @@ set_optimize_info_from_tree(Node* node, regex_t* reg, ScanEnv* scan_env) if (r) return r; reg->anchor = opt.anc.left_anchor & (ANCHOR_BEGIN_BUF | - ANCHOR_BEGIN_POSITION | ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML); + ANCHOR_BEGIN_POSITION | ANCHOR_ANYCHAR_STAR | ANCHOR_ANYCHAR_STAR_ML | + ANCHOR_LOOK_BEHIND); reg->anchor |= opt.anc.right_anchor & (ANCHOR_END_BUF | ANCHOR_SEMI_END_BUF); |