1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

dsl.rb: ID constants

* ext/ripper/tools/dsl.rb (DSL#method_missing): expand ID
  constnats without parentheses.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-01-20 05:39:02 +00:00
parent b54f2addaa
commit b5be3e7893
2 changed files with 4 additions and 2 deletions

View file

@ -43,6 +43,8 @@ class DSL
event = $`
@events[event] = args.size
"dispatch#{ args.size }(#{ [event, *args].join(", ") })"
elsif args.empty? and /\Aid[A-Z]/ =~ event.to_s
event
else
"#{ event }(#{ args.join(", ") })"
end

View file

@ -1646,7 +1646,7 @@ lhs : user_variable
/*%%%*/
$$ = attrset(p, $1, idCOLON2, $3, &@$);
/*% %*/
/*% ripper: field!($1, "ID2VAL(idCOLON2)", $3) %*/
/*% ripper: field!($1, ID2VAL(idCOLON2), $3) %*/
}
| primary_value call_op tCONSTANT
{
@ -3613,7 +3613,7 @@ numeric : simple_numeric
$$ = $2;
add_mark_object(p, $$->nd_lit = negate_lit(p, $$->nd_lit));
/*% %*/
/*% ripper: unary!("ID2VAL(idUMinus)", $2) %*/
/*% ripper: unary!(ID2VAL(idUMinus), $2) %*/
}
;