ruby-changes:48710
From: nobu <ko1@a...>
Date: Fri, 17 Nov 2017 21:16:37 +0900 (JST)
Subject: [ruby-changes:48710] nobu:r60826 (trunk): parse.y: RUBY_SET_YYLLOC to rb_parser_set_location
nobu 2017-11-17 21:16:31 +0900 (Fri, 17 Nov 2017) New Revision: 60826 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60826 Log: parse.y: RUBY_SET_YYLLOC to rb_parser_set_location Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 60825) +++ parse.y (revision 60826) @@ -63,14 +63,7 @@ https://github.com/ruby/ruby/blob/trunk/parse.y#L63 while (0) #define RUBY_SET_YYLLOC(Current) \ - do \ - { \ - (Current).first_loc.lineno = ruby_sourceline; \ - (Current).first_loc.column = (int)(parser->tokp - lex_pbeg); \ - (Current).last_loc.lineno = ruby_sourceline; \ - (Current).last_loc.column = (int)(lex_p - lex_pbeg); \ - } \ - while (0) + rb_parser_set_location(parser, &(Current)) #undef malloc #undef realloc @@ -690,6 +683,7 @@ enum lex_state_e rb_parser_trace_lex_sta https://github.com/ruby/ruby/blob/trunk/parse.y#L683 VALUE rb_parser_lex_state_name(enum lex_state_e state); void rb_parser_show_bitstack(struct parser_params *, stack_type, const char *, int); PRINTF_ARGS(void rb_parser_fatal(struct parser_params *parser, const char *fmt, ...), 2, 3); +void rb_parser_set_location(struct parser_params *parser, YYLTYPE *yylloc); RUBY_SYMBOL_EXPORT_END static ID formal_argument_gen(struct parser_params*, ID); @@ -9828,6 +9822,15 @@ rb_parser_fatal(struct parser_params *pa https://github.com/ruby/ruby/blob/trunk/parse.y#L9822 parser->debug_output = rb_stderr; yydebug = TRUE; } + +void +rb_parser_set_location(struct parser_params *parser, YYLTYPE *yylloc) +{ + yylloc->first_loc.lineno = ruby_sourceline; + yylloc->first_loc.column = (int)(parser->tokp - lex_pbeg); + yylloc->last_loc.lineno = ruby_sourceline; + yylloc->last_loc.column = (int)(lex_p - lex_pbeg); +} #endif /* !RIPPER */ #ifndef RIPPER -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/