ruby-changes:49081
From: yui-knk <ko1@a...>
Date: Wed, 13 Dec 2017 08:48:55 +0900 (JST)
Subject: [ruby-changes:49081] yui-knk:r61196 (trunk): parse.y: Fix the locations of an empty script
yui-knk 2017-12-13 08:48:50 +0900 (Wed, 13 Dec 2017) New Revision: 61196 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61196 Log: parse.y: Fix the locations of an empty script * parse.y: Fix the locations of NODE_BEGIN in an empty script. ``` ruby --dump=p -e '' ``` * Before ``` NODE_BEGIN (line: 1, code_range: (1,1)-(1,1)) ``` * After ``` NODE_BEGIN (line: 1, code_range: (1,0)-(1,0)) ``` Modified files: trunk/parse.y Index: parse.y =================================================================== --- parse.y (revision 61195) +++ parse.y (revision 61196) @@ -1205,7 +1205,7 @@ top_compstmt : top_stmts opt_terms https://github.com/ruby/ruby/blob/trunk/parse.y#L1205 top_stmts : none { /*%%%*/ - $$ = new_begin(0, &@$); + $$ = new_begin(0, &@0); /*% $$ = dispatch2(stmts_add, dispatch0(stmts_new), dispatch0(void_stmt)); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/