diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-07-04 17:23:34 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-07-04 17:28:23 +0900 |
commit | 74e1bca79d703f2658ac9cfa6d990e7e77c59757 (patch) | |
tree | 5a204eb1bf1765239b4accd0f91e736ce7b272bf /sprintf.c | |
parent | 7a5da7d55d40e431e561ab2c891b7cab155e74db (diff) | |
download | ruby-74e1bca79d703f2658ac9cfa6d990e7e77c59757.tar.gz |
support all locals for cexpr!, cstmt!
Primitve.cexpr! and .cstmt! can access Ruby's parameter and
*local variables* (note that local parameters are also local
variables). However recent changes only allow to access
parameters. This patch fix it.
For example, the following code can work:
def foo a, b, k: :kw, **kwrest
c = a + b
d = k
e = kwrest
p Primitive.cstmt!(%q(rb_p(rb_ary_new_from_args(5, a, b, c, d, e));
return Qnil;))
end
Diffstat (limited to 'sprintf.c')
0 files changed, 0 insertions, 0 deletions