1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix locations of NODE_SCOPE in lambda.

* parse.y: Fix to start with the argument.

  e.g. The locations of the NODE_SCOPE is fixed:

  ```
  -> x { 1 + 2 }
  ```

  * Before

  ```
  NODE_SCOPE (line: 1, location: (1,2)-(1,14))
  ```

  * After

  ```
  NODE_SCOPE (line: 1, location: (1,3)-(1,14))
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
yui-knk 2018-10-20 10:53:31 +00:00
parent b5425ad780
commit 4d4b60acea

View file

@ -3132,7 +3132,8 @@ lambda : {
p->lex.lpar_beg = $<num>2;
CMDARG_POP();
/*%%%*/
$$ = NEW_LAMBDA($3, $5, &@$);
YYLTYPE loc = code_loc_gen(&@3, &@5);
$$ = NEW_LAMBDA($3, $5, &loc);
nd_set_line($$->nd_body, @5.end_pos.lineno);
nd_set_line($$, @3.end_pos.lineno);
/*% %*/