diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-26 03:55:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-10-26 03:55:08 +0000 |
commit | f93877132f7a36c8eb734a13eec0fcb2cb9fb2e7 (patch) | |
tree | cf689f14792809b0d2c4aba7814cf497b2c57e67 /parse.y | |
parent | fa5eb490b3a160f3158cafc2711bbc34cad1faac (diff) | |
download | ruby-f93877132f7a36c8eb734a13eec0fcb2cb9fb2e7.tar.gz |
parse.y: call_op2
* parse.y (call_op2): separate from call_op and also allow "::",
while dot_or_colon should not allow ".?". [Feature #11537]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -847,7 +847,7 @@ static void token_info_pop(struct parser_params*, const char *token, size_t len) %type <node> mlhs mlhs_head mlhs_basic mlhs_item mlhs_node mlhs_post mlhs_inner %type <id> fsym keyword_variable user_variable sym symbol operation operation2 operation3 %type <id> cname fname op f_rest_arg f_block_arg opt_f_block_arg f_norm_arg f_bad_arg -%type <id> f_kwrest f_label f_arg_asgn call_op +%type <id> f_kwrest f_label f_arg_asgn call_op call_op2 /*%%%*/ /*% %type <val> program reswords then do dot_or_colon @@ -1395,7 +1395,7 @@ command_call : command ; block_command : block_call - | block_call dot_or_colon operation2 command_args + | block_call call_op2 operation2 command_args { /*%%%*/ $$ = NEW_CALL($1, $3, $4); @@ -3608,7 +3608,7 @@ block_call : command do_block $$ = method_add_block($1, $2); %*/ } - | block_call dot_or_colon operation2 opt_paren_args + | block_call call_op2 operation2 opt_paren_args { /*%%%*/ $$ = NEW_CALL($1, $3, $4); @@ -3617,7 +3617,7 @@ block_call : command do_block $$ = method_optarg($$, $4); %*/ } - | block_call dot_or_colon operation2 opt_paren_args brace_block + | block_call call_op2 operation2 opt_paren_args brace_block { /*%%%*/ block_dup_check($4, $5); @@ -3629,7 +3629,7 @@ block_call : command do_block $$ = method_add_block($$, $5); %*/ } - | block_call dot_or_colon operation2 command_args do_block + | block_call call_op2 operation2 command_args do_block { /*%%%*/ block_dup_check($4, $5); @@ -5107,7 +5107,7 @@ operation3 : tIDENTIFIER | op ; -dot_or_colon : call_op +dot_or_colon : '.' /*%c%*/ /*%c { $$ = $<val>1; } @@ -5123,6 +5123,10 @@ call_op : '.' {$$ = '.';} | tDOTQ {$$ = tDOTQ;} ; +call_op2 : call_op + | tCOLON2 {$$ = tCOLON2;} + ; + opt_terms : /* none */ | terms ; |