summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-20 10:53:31 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-20 10:53:31 +0000
commit4d4b60aceac9daceeea1e0fc0112821dbcd10567 (patch)
tree9f3373e34914f62d36afb695111ee9002d565462 /parse.y
parentb5425ad780b06bc24362953097fd3baf5f1147c4 (diff)
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
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 431ad0118d..9c1911d640 100644
--- a/parse.y
+++ b/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);
/*% %*/