summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-11 12:42:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-11 12:42:50 +0000
commitcc2334bd7bdeae8e91397576020d397a3d04af5f (patch)
tree93fcdac5b5aa7c4d11a6e011a89275cd2103ffac /parse.y
parenta3cb2093ef475648c1845b70122639e9f69e85e7 (diff)
* eval.c (rb_obj_respond_to): check if obj responds to the given
method with the given visibility. [ruby-dev:27408] * eval.c (rb_respond_to): conform to Object#respond_to?. [ruby-dev:27411] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y11
1 files changed, 1 insertions, 10 deletions
diff --git a/parse.y b/parse.y
index f254817d22..86dcfc7cc8 100644
--- a/parse.y
+++ b/parse.y
@@ -8953,15 +8953,6 @@ ripper_s_allocate(VALUE klass)
return self;
}
-static int
-obj_respond_to(VALUE obj, VALUE mid)
-{
- VALUE st;
-
- st = rb_funcall(obj, rb_intern("respond_to?"), 2, mid, Qfalse);
- return RTEST(st);
-}
-
#define ripper_initialized_p(r) ((r)->parser_lex_input != 0)
/*
@@ -8982,7 +8973,7 @@ ripper_initialize(int argc, VALUE *argv, VALUE self)
Data_Get_Struct(self, struct parser_params, parser);
rb_scan_args(argc, argv, "12", &src, &fname, &lineno);
- if (obj_respond_to(src, ID2SYM(ripper_id_gets))) {
+ if (rb_obj_respond_to(src, ripper_id_gets, 0)) {
parser->parser_lex_gets = ripper_lex_get_generic;
}
else {