ruby-changes:55097
From: nobu <ko1@a...>
Date: Tue, 19 Mar 2019 11:25:20 +0900 (JST)
Subject: [ruby-changes:55097] nobu:r67304 (trunk): Added Ripper#debug_output
nobu 2019-03-19 11:25:15 +0900 (Tue, 19 Mar 2019) New Revision: 67304 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67304 Log: Added Ripper#debug_output Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 67303) +++ parse.y (revision 67304) @@ -11222,10 +11222,14 @@ rb_parser_set_context(VALUE vparser, con https://github.com/ruby/ruby/blob/trunk/parse.y#L11222 #define rb_parser_encoding ripper_parser_encoding #define rb_parser_get_yydebug ripper_parser_get_yydebug #define rb_parser_set_yydebug ripper_parser_set_yydebug +#define rb_parser_get_debug_output ripper_parser_get_debug_output +#define rb_parser_set_debug_output ripper_parser_set_debug_output static VALUE ripper_parser_end_seen_p(VALUE vparser); static VALUE ripper_parser_encoding(VALUE vparser); static VALUE ripper_parser_get_yydebug(VALUE self); static VALUE ripper_parser_set_yydebug(VALUE self, VALUE flag); +static VALUE ripper_parser_get_debug_output(VALUE self); +static VALUE ripper_parser_set_debug_output(VALUE self, VALUE output); /* * call-seq: @@ -11304,6 +11308,36 @@ rb_parser_set_yydebug(VALUE self, VALUE https://github.com/ruby/ruby/blob/trunk/parse.y#L11308 return flag; } +/* + * call-seq: + * ripper.debug_output -> obj + * + * Get debug output. + */ +VALUE +rb_parser_get_debug_output(VALUE self) +{ + struct parser_params *p; + + TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p); + return p->debug_output; +} + +/* + * call-seq: + * ripper.debug_output = obj + * + * Set debug output. + */ +VALUE +rb_parser_set_debug_output(VALUE self, VALUE output) +{ + struct parser_params *p; + + TypedData_Get_Struct(self, struct parser_params, &parser_data_type, p); + return p->debug_output = output; +} + #ifndef RIPPER #ifdef YYMALLOC #define HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE)) @@ -11900,6 +11934,8 @@ InitVM_ripper(void) https://github.com/ruby/ruby/blob/trunk/parse.y#L11934 rb_define_method(Ripper, "encoding", rb_parser_encoding, 0); rb_define_method(Ripper, "yydebug", rb_parser_get_yydebug, 0); rb_define_method(Ripper, "yydebug=", rb_parser_set_yydebug, 1); + rb_define_method(Ripper, "debug_output", rb_parser_get_debug_output, 0); + rb_define_method(Ripper, "debug_output=", rb_parser_set_debug_output, 1); rb_define_method(Ripper, "error?", ripper_error_p, 0); #ifdef RIPPER_DEBUG rb_define_method(rb_mKernel, "assert_Qundef", ripper_assert_Qundef, 2); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/