ripper_with_T_FILE.diff

T_FILEの方に倒したripper - Masaki Matsushita, 07/01/2012 10:57 PM

Download (1.26 KB)

View differences:

parse.y
505 505

  
506 506
#include "eventids1.c"
507 507
#include "eventids2.c"
508
static ID ripper_id_gets;
509 508

  
510 509
static VALUE ripper_dispatch0(struct parser_params*,ID);
511 510
static VALUE ripper_dispatch1(struct parser_params*,ID,VALUE);
......
11053 11052
static VALUE
11054 11053
ripper_lex_get_generic(struct parser_params *parser, VALUE src)
11055 11054
{
11056
    return rb_funcall(src, ripper_id_gets, 0);
11055
    return rb_io_gets(src);
11057 11056
}
11058 11057

  
11059 11058
static VALUE
......
11089 11088

  
11090 11089
    TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
11091 11090
    rb_scan_args(argc, argv, "12", &src, &fname, &lineno);
11092
    if (rb_obj_respond_to(src, ripper_id_gets, 0)) {
11091
    if (RB_TYPE_P(src, T_FILE)) {
11093 11092
        parser->parser_lex_gets = ripper_lex_get_generic;
11094 11093
    }
11095 11094
    else {
......
11253 11252
{
11254 11253
    parser_data_type.parent = RTYPEDDATA_TYPE(rb_parser_new());
11255 11254

  
11256
    ripper_id_gets = rb_intern("gets");
11257 11255
    ripper_init_eventids1();
11258 11256
    ripper_init_eventids2();
11259 11257
    /* ensure existing in symbol table */