summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-17 14:34:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-17 14:34:13 +0000
commitc4d77cb4adaae2bab9aa015c9a0528f0abf07bbd (patch)
tree54c9fd45bb99576b62ca63c98c05124123b1ed82 /parse.y
parent19c312afee311fe4a753e9440e01eb614c9fbf0e (diff)
downloadbundler-c4d77cb4adaae2bab9aa015c9a0528f0abf07bbd.tar.gz
* parse.y (parser_data_type): inherit the core type in ripper so
that checks in core would work. [ruby-core:39591] [Bug #5331] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y18
1 files changed, 16 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 73aaaabf33..ab17534b36 100644
--- a/parse.y
+++ b/parse.y
@@ -5290,9 +5290,11 @@ lex_getline(struct parser_params *parser)
return line;
}
+#ifdef RIPPER
+static rb_data_type_t parser_data_type;
+#else
static const rb_data_type_t parser_data_type;
-#ifndef RIPPER
static NODE*
parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int line)
{
@@ -10345,7 +10347,11 @@ parser_memsize(const void *ptr)
return size;
}
-static const rb_data_type_t parser_data_type = {
+static
+#ifndef RIPPER
+const
+#endif
+rb_data_type_t parser_data_type = {
"parser",
{
parser_mark,
@@ -10961,11 +10967,19 @@ ripper_value(VALUE self, VALUE obj)
}
#endif
+
+void
+InitVM_ripper(void)
+{
+ parser_data_type.parent = RTYPEDDATA_TYPE(rb_parser_new());
+}
+
void
Init_ripper(void)
{
VALUE Ripper;
+ InitVM(ripper);
Ripper = rb_define_class("Ripper", rb_cObject);
rb_define_const(Ripper, "Version", rb_usascii_str_new2(RIPPER_VERSION));
rb_define_alloc_func(Ripper, ripper_s_allocate);