diff --git a/parse.y b/parse.y index f134e15270..72ee78e7fa 100644 --- a/parse.y +++ b/parse.y @@ -1906,16 +1906,24 @@ arg : lhs '=' arg_rhs | arg tDOT2 { /*%%%*/ + YYLTYPE loc; + loc.beg_pos = @2.end_pos; + loc.end_pos = @2.end_pos; + value_expr($1); - $$ = NEW_DOT2($1, new_nil(&@$), &@$); + $$ = NEW_DOT2($1, new_nil(&loc), &@$); /*% %*/ /*% ripper: dot2!($1, Qnil) %*/ } | arg tDOT3 { /*%%%*/ + YYLTYPE loc; + loc.beg_pos = @2.end_pos; + loc.end_pos = @2.end_pos; + value_expr($1); - $$ = NEW_DOT3($1, new_nil(&@$), &@$); + $$ = NEW_DOT3($1, new_nil(&loc), &@$); /*% %*/ /*% ripper: dot3!($1, Qnil) %*/ }