summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-20 10:10:46 +0000
committeryui-knk <yui-knk@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-20 10:10:46 +0000
commit46447667f19657a100ccdc998f258ca13287329a (patch)
tree879b35d3eff426f9aa6f061e752f4211b961f20a /parse.y
parentf16326fddaa05cea4ec00c6c4970d9e0ff96bd05 (diff)
Fix locations of NODE_LAMBDA.
* node.h: Add `nd_first_loc` and `nd_set_first_loc` * parse.y: Fix to start with the beginning of `->` . e.g. The locations of the NODE_LAMBDA is fixed: ``` -> x { 1 + 2 } ``` * Before ``` NODE_LAMBDA (line: 1, location: (1,2)-(1,14)) ``` * After ``` NODE_LAMBDA (line: 1, location: (1,0)-(1,14)) ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 9cb94fd644..431ad0118d 100644
--- a/parse.y
+++ b/parse.y
@@ -2443,6 +2443,9 @@ primary : literal
lambda
{
$$ = $3;
+ /*%%%*/
+ nd_set_first_loc($$, @1.beg_pos);
+ /*% %*/
}
| k_if expr_value then
compstmt