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:
parent
b5425ad780
commit
4d4b60acea
1 changed files with 2 additions and 1 deletions
3
parse.y
3
parse.y
|
@ -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);
|
||||
/*% %*/
|
||||
|
|
Loading…
Add table
Reference in a new issue