diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-11 21:44:49 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-11 21:44:49 +0000 |
commit | 0314f93ef402083ea5fd7cb2015f7a98cd0a3358 (patch) | |
tree | 218d0e4eb2db8ae9d1002708eee1f66d9ecdca0f /vm_core.h | |
parent | 64bbd55c85a3f3d7c88ba898d81e55f068e9eb7e (diff) |
* iseq.c (rb_iseq_parameters): fix limit for optional arguments.
* test/ruby/test_keyword.rb: tests for above.
* vm_core.h (struct rb_iseq_struct): update documentation
with keyword arguments. [Bug #7540] [ruby-core:50735]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -241,20 +241,24 @@ struct rb_iseq_struct { * b1=(...), b2=(...), ..., bN=(...), # optional * *c, # rest * d1, d2, ..., dO, # post - * &e) # block + * e1:(...), e2:(...), ..., eK:(...), # keyword + * **f, # keyword rest + * &g) # block * => * - * argc = M - * arg_rest = M+N+1 // or -1 if no rest arg - * arg_opts = N+1 // or 0 if no optional arg + * argc = M // or 0 if no mandatory arg + * arg_opts = N+1 // or 0 if no optional arg + * arg_rest = M+N // or -1 if no rest arg * arg_opt_table = [ (arg_opts entries) ] - * arg_post_len = O // 0 if no post arguments - * arg_post_start = M+N+2 - * arg_block = M+N + 1 + O + 1 // -1 if no block arg + * arg_post_start = M+N+(*1) // or 0 if no post arguments + * arg_post_len = O // or 0 if no post arguments + * arg_keywords = K // or 0 if no keyword arg + * arg_block = M+N+(*1)+O+K // or -1 if no block arg + * arg_keyword = M+N+(*1)+O+K+(&1) // or -1 if no keyword arg/rest * arg_simple = 0 if not simple arguments. * = 1 if no opt, rest, post, block. * = 2 if ambiguous block parameter ({|a|}). - * arg_size = argument size. + * arg_size = M+N+O+(*1)+K+(&1)+(**1) argument size. */ int argc; |