* parse.y (RUBY_SET_YYLLOC): extract setting locations from the
  source line.

* parse.y (yylex): use RUBY_SET_YYLLOC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-11-17 12:16:30 +00:00
Родитель 8d7d8d0c7f
Коммит 3465fdd44e
1 изменённых файлов: 6 добавлений и 4 удалений

10
parse.y
Просмотреть файл

@ -59,6 +59,11 @@
(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, struct parser_params *parser)
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;
}