ruby-changes:48709
From: nobu <ko1@a...>
Date: Fri, 17 Nov 2017 21:16:37 +0900 (JST)
Subject: [ruby-changes:48709] nobu:r60825 (trunk): parse.y: RUBY_SET_YYLLOC
nobu 2017-11-17 21:16:30 +0900 (Fri, 17 Nov 2017) New Revision: 60825 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60825 Log: parse.y: RUBY_SET_YYLLOC * parse.y (RUBY_SET_YYLLOC): extract setting locations from the source line. * parse.y (yylex): use RUBY_SET_YYLLOC. Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 60824) +++ parse.y (revision 60825) @@ -59,6 +59,11 @@ https://github.com/ruby/ruby/blob/trunk/parse.y#L59 (Current).last_loc = YYRHSLOC(Rhs, N).last_loc; \ } \ else \ + RUBY_SET_YYLLOC(Current); \ + while (0) + +#define RUBY_SET_YYLLOC(Current) \ + do \ { \ (Current).first_loc.lineno = ruby_sourceline; \ (Current).first_loc.column = (int)(parser->tokp - lex_pbeg); \ @@ -8893,10 +8898,7 @@ yylex(YYSTYPE *lval, YYLTYPE *yylloc, st https://github.com/ruby/ruby/blob/trunk/parse.y#L8898 else if (t != 0) dispatch_scan_event(t); - 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); + RUBY_SET_YYLLOC(*yylloc); return t; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/