summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-14 13:51:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-11-14 13:51:19 +0000
commit604689628dc64d050a68f1ebe5e06f9105474936 (patch)
tree84a09689df2b995caae9e56689d050723718ed6d /parse.y
parenta1c02ee495d945f943fedc3f11fcb323289dc756 (diff)
* configure.in (LIBRUBY_A): append -static. [ruby-dev:18689]
* configure.in (LIBRUBYARG_STATIC, LIBRUBYARG_SHARED): linker argument to link static/shared library respectively. * Makefile.in (LIBRUBYARG_STATIC, LIBRUBYARG_SHARED): added. * bcc32/Makefile.sub, win32/Makefile.sub: ditto. * instruby.rb (LIBRUBY_A): install to libdir. * lib/mkmf.rb (link_command): link static library of ruby, or try_run fails unless LIBRUBY_SO is installed. [ruby-dev:18646] * eval.c (call_trace_func): toplevel caller was missing. [ruby-dev:18754] * eval.c (proc_to_s): adjust created line number. * parse.y (primary, do_block, brace_block): adjust line number of block to beginning line, instead of the first statement inside the block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y23
1 files changed, 17 insertions, 6 deletions
diff --git a/parse.y b/parse.y
index 5b8417f..3aef278 100644
--- a/parse.y
+++ b/parse.y
@@ -1302,10 +1302,14 @@ primary : literal
$$ = NEW_VCALL($1);
}
| kBEGIN
+ {
+ $<num>1 = ruby_sourceline;
+ }
bodystmt
kEND
{
- $$ = NEW_BEGIN($2);
+ $$ = NEW_BEGIN($3);
+ nd_set_line($$, $<num>1);
}
| tLPAREN_ARG expr {lex_state = EXPR_ENDARG;} ')'
{
@@ -1589,22 +1593,27 @@ opt_block_var : none
do_block : kDO_BLOCK
{
$<vars>$ = dyna_push();
+ $<num>1 = ruby_sourceline;
}
opt_block_var
compstmt
kEND
{
$$ = NEW_ITER($3, 0, $4);
- fixpos($$, $3?$3:$4);
+ nd_set_line($$, $<num>1);
dyna_pop($<vars>2);
}
- | tLBRACE_ARG {$<vars>$ = dyna_push();}
+ | tLBRACE_ARG
+ {
+ $<vars>$ = dyna_push();
+ $<num>1 = ruby_sourceline;
+ }
opt_block_var
compstmt
'}'
{
$$ = NEW_ITER($3, 0, $4);
- fixpos($$, $3?$3:$4);
+ nd_set_line($$, $<num>1);
dyna_pop($<vars>2);
}
@@ -1661,23 +1670,25 @@ method_call : operation paren_args
brace_block : '{'
{
$<vars>$ = dyna_push();
+ $<num>1 = ruby_sourceline;
}
opt_block_var
compstmt '}'
{
$$ = NEW_ITER($3, 0, $4);
- fixpos($$, $4);
+ nd_set_line($$, $<num>1);
dyna_pop($<vars>2);
}
| kDO
{
$<vars>$ = dyna_push();
+ $<num>1 = ruby_sourceline;
}
opt_block_var
compstmt kEND
{
$$ = NEW_ITER($3, 0, $4);
- fixpos($$, $4);
+ nd_set_line($$, $<num>1);
dyna_pop($<vars>2);
}
;