Project

General

Profile

Bug #5989

Keyword spash is syntax error when there are no explicit keyword arguments

Added by funny_falcon (Yura Sokolov) almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 2.0.0dev (2012-02-09 trunk 34505) [i686-linux]
[ruby-core:42455]

Description

$ ruby -e 'def a(a:1, **h); p h; end; a(b: 1)'
{:b=>1}
$ ruby -e 'def a(**h); p h; end; a(b: 1)'
-e:1: syntax error, unexpected tPOW, expecting ')'
def a(**h); p h; end
        ^

Associated revisions

Revision 34998
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

  • parse.y (block_param, f_args): add rules for the case arguments begin with kwrest. [Bug #5989]

Revision 34998
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

  • parse.y (block_param, f_args): add rules for the case arguments begin with kwrest. [Bug #5989]

Revision 34998
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

  • parse.y (block_param, f_args): add rules for the case arguments begin with kwrest. [Bug #5989]

Revision 34998
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

  • parse.y (block_param, f_args): add rules for the case arguments begin with kwrest. [Bug #5989]

Revision 34999
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

  • compile.c (iseq_set_arguments): keyword rest arg without keyword args.
  • node.c (dump_node): dump kw_rest_arg too.
  • parse.y (block_param, f_arg): more kwrest patterns. [Bug #5989]
  • parse.y (new_args_gen): no extra kw_rest_arg if no keyword rest arg.

Revision 34999
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

  • compile.c (iseq_set_arguments): keyword rest arg without keyword args.
  • node.c (dump_node): dump kw_rest_arg too.
  • parse.y (block_param, f_arg): more kwrest patterns. [Bug #5989]
  • parse.y (new_args_gen): no extra kw_rest_arg if no keyword rest arg.

Revision 34999
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

  • compile.c (iseq_set_arguments): keyword rest arg without keyword args.
  • node.c (dump_node): dump kw_rest_arg too.
  • parse.y (block_param, f_arg): more kwrest patterns. [Bug #5989]
  • parse.y (new_args_gen): no extra kw_rest_arg if no keyword rest arg.

Revision 34999
Added by nobu (Nobuyoshi Nakada) almost 6 years ago

  • compile.c (iseq_set_arguments): keyword rest arg without keyword args.
  • node.c (dump_node): dump kw_rest_arg too.
  • parse.y (block_param, f_arg): more kwrest patterns. [Bug #5989]
  • parse.y (new_args_gen): no extra kw_rest_arg if no keyword rest arg.

History

#1 Updated by ko1 (Koichi Sasada) almost 6 years ago

  • Assignee set to mame (Yusuke Endoh)

#2 Updated by nobu (Nobuyoshi Nakada) almost 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r34998.
Yura, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • parse.y (block_param, f_args): add rules for the case arguments begin with kwrest. [Bug #5989]

#3 [ruby-core:43263] Updated by nobu (Nobuyoshi Nakada) almost 6 years ago

  • Status changed from Closed to Open
  • % Done changed from 100 to 20

#4 Updated by nobu (Nobuyoshi Nakada) almost 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 20 to 100

This issue was solved with changeset r34999.
Yura, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • compile.c (iseq_set_arguments): keyword rest arg without keyword args.
  • node.c (dump_node): dump kw_rest_arg too.
  • parse.y (block_param, f_arg): more kwrest patterns. [Bug #5989]
  • parse.y (new_args_gen): no extra kw_rest_arg if no keyword rest arg.

Also available in: Atom PDF