Project

General

Profile

Actions

Bug #5989

closed

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

Added by funny_falcon (Yura Sokolov) over 12 years ago. Updated over 12 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.0.0dev (2012-02-09 trunk 34505) [i686-linux]
Backport:
[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
        ^
Actions #1

Updated by ko1 (Koichi Sasada) over 12 years ago

  • Assignee set to mame (Yusuke Endoh)
Actions #2

Updated by nobu (Nobuyoshi Nakada) over 12 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. [ruby-core:42455][Bug #5989]

Updated by nobu (Nobuyoshi Nakada) over 12 years ago

  • Status changed from Closed to Open
  • % Done changed from 100 to 20
Actions #4

Updated by nobu (Nobuyoshi Nakada) over 12 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.
    [ruby-core:42455][Bug #5989]
  • parse.y (new_args_gen): no extra kw_rest_arg if no keyword rest arg.
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0