summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-29 12:22:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-29 12:22:01 +0000
commite878df745ca89ecdb07090ad2bb99fd433dfc3a3 (patch)
treef19ee613be1c68c4167b2b34415543bfa5c4e4a5 /parse.y
parenteb56c1084d57e59b9daab78b22812660d890a354 (diff)
use RB_TYPE_P
* enumerator.c (enumerator_initialize), eval.c (rb_using_refinement), (add_activated_refinement), numeric.c (num_interval_step_size), parse.y (arg, match_op_gen, cond0), range.c (range_bsearch), vm_insnhelper.c (vm_get_iclass): use RB_TYPE_P() to optimize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/parse.y b/parse.y
index 2b119d465d..1b57719296 100644
--- a/parse.y
+++ b/parse.y
@@ -2238,7 +2238,7 @@ arg : lhs '=' arg
{
/*%%%*/
$$ = match_op($1, $3);
- if (nd_type($1) == NODE_LIT && TYPE($1->nd_lit) == T_REGEXP) {
+ if (nd_type($1) == NODE_LIT && RB_TYPE_P($1->nd_lit, T_REGEXP)) {
$$ = reg_named_capture_assign($1->nd_lit, $$);
}
/*%
@@ -8370,7 +8370,7 @@ match_op_gen(struct parser_params *parser, NODE *node1, NODE *node2)
return NEW_MATCH2(node1, node2);
case NODE_LIT:
- if (TYPE(node1->nd_lit) == T_REGEXP) {
+ if (RB_TYPE_P(node1->nd_lit, T_REGEXP)) {
return NEW_MATCH2(node1, node2);
}
}
@@ -8383,7 +8383,7 @@ match_op_gen(struct parser_params *parser, NODE *node1, NODE *node2)
return NEW_MATCH3(node2, node1);
case NODE_LIT:
- if (TYPE(node2->nd_lit) == T_REGEXP) {
+ if (RB_TYPE_P(node2->nd_lit, T_REGEXP)) {
return NEW_MATCH3(node2, node1);
}
}
@@ -9138,7 +9138,7 @@ cond0(struct parser_params *parser, NODE *node)
break;
case NODE_LIT:
- if (TYPE(node->nd_lit) == T_REGEXP) {
+ if (RB_TYPE_P(node->nd_lit, T_REGEXP)) {
warn_unless_e_option(parser, node, "regex literal in condition");
nd_set_type(node, NODE_MATCH);
}