summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-26 13:47:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-26 13:47:01 +0000
commit77a9d7c32f8a8b74c63e999af8e5c11506dee8e2 (patch)
tree976a8b15651da7538c6e624bf56f07aeba99d84e /parse.y
parent3e9276a5389c95f0d010b39bffd7c53f16197693 (diff)
* parse.y (primary, brace_block): fix for line number.
* proc.c (rb_proc_location, rb_method_location): new methods {Proc,Method,UnboundMethod}#source_location. [ruby-core:18452] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 29770aed3d..463b77e993 100644
--- a/parse.y
+++ b/parse.y
@@ -2886,6 +2886,7 @@ primary : literal
reduce_nodes(&body);
$$ = NEW_DEFN($2, $4, body, NOEX_PRIVATE);
fixpos($$, $4);
+ fixpos($$->nd_defn, $4);
local_pop();
in_def--;
cur_mid = $<id>3;
@@ -2913,6 +2914,7 @@ primary : literal
reduce_nodes(&body);
$$ = NEW_DEFS($2, $5, $7, body);
fixpos($$, $2);
+ fixpos($$->nd_defn, $2);
local_pop();
in_single--;
/*%
@@ -3611,6 +3613,8 @@ brace_block : '{'
/*%%%*/
$$ = NEW_ITER($3,$4);
nd_set_line($$, $<num>2);
+ nd_set_line($$->nd_body, $<num>2);
+ nd_set_line($$->nd_body->nd_body, $<num>2);
dyna_pop();
/*%
$$ = dispatch2(brace_block, escape_Qundef($3), $4);