From d62f56b04182f5b7b02944d5c169fe44513135b1 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 13 Dec 2011 15:01:20 +0000 Subject: * parse.y (primary): point method name line. [ruby-core:40936] [Bug #5614] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- parse.y | 70 ++++++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 20 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index c3701124ff..36bdd49370 100644 --- a/parse.y +++ b/parse.y @@ -3645,33 +3645,51 @@ block_call : command do_block } ; -method_call : operation paren_args +method_call : operation { /*%%%*/ - $$ = NEW_FCALL($1, $2); - fixpos($$, $2); + $$ = ruby_sourceline; + /*% %*/ + } + paren_args + { + /*%%%*/ + $$ = NEW_FCALL($1, $3); + nd_set_line($$, $2); /*% - $$ = method_arg(dispatch1(fcall, $1), $2); + $$ = method_arg(dispatch1(fcall, $1), $3); %*/ } - | primary_value '.' operation2 opt_paren_args + | primary_value '.' operation2 { /*%%%*/ - $$ = NEW_CALL($1, $3, $4); - fixpos($$, $1); + $$ = ruby_sourceline; + /*% %*/ + } + opt_paren_args + { + /*%%%*/ + $$ = NEW_CALL($1, $3, $5); + nd_set_line($$, $4); /*% $$ = dispatch3(call, $1, ripper_id2sym('.'), $3); - $$ = method_optarg($$, $4); + $$ = method_optarg($$, $5); %*/ } - | primary_value tCOLON2 operation2 paren_args + | primary_value tCOLON2 operation2 { /*%%%*/ - $$ = NEW_CALL($1, $3, $4); - fixpos($$, $1); + $$ = ruby_sourceline; + /*% %*/ + } + paren_args + { + /*%%%*/ + $$ = NEW_CALL($1, $3, $5); + nd_set_line($$, $4); /*% $$ = dispatch3(call, $1, ripper_id2sym('.'), $3); - $$ = method_optarg($$, $4); + $$ = method_optarg($$, $5); %*/ } | primary_value tCOLON2 operation3 @@ -3682,26 +3700,38 @@ method_call : operation paren_args $$ = dispatch3(call, $1, ripper_intern("::"), $3); %*/ } - | primary_value '.' paren_args + | primary_value '.' { /*%%%*/ - $$ = NEW_CALL($1, rb_intern("call"), $3); - fixpos($$, $1); + $$ = ruby_sourceline; + /*% %*/ + } + paren_args + { + /*%%%*/ + $$ = NEW_CALL($1, rb_intern("call"), $4); + nd_set_line($$, $3); /*% $$ = dispatch3(call, $1, ripper_id2sym('.'), ripper_intern("call")); - $$ = method_optarg($$, $3); + $$ = method_optarg($$, $4); %*/ } - | primary_value tCOLON2 paren_args + | primary_value tCOLON2 { /*%%%*/ - $$ = NEW_CALL($1, rb_intern("call"), $3); - fixpos($$, $1); + $$ = ruby_sourceline; + /*% %*/ + } + paren_args + { + /*%%%*/ + $$ = NEW_CALL($1, rb_intern("call"), $4); + nd_set_line($$, $3); /*% $$ = dispatch3(call, $1, ripper_intern("::"), ripper_intern("call")); - $$ = method_optarg($$, $3); + $$ = method_optarg($$, $4); %*/ } | keyword_super paren_args -- cgit v1.2.3