Project

General

Profile

This project is closed and read-only.

Actions

Backport #7942

closed

keyword arguments must use with paren?

Backport #7942: keyword arguments must use with paren?

Added by jjyr (Jinyang Jiang) over 13 years ago. Updated over 13 years ago.


Description

def hello name: "ruby2"
puts "hello #{name}"
end

syntax error, unexpected ':', expecting ';' or '\n'

def hello(name: "ruby2")
puts "hello #{name}"
end

work well

Updated by ko1 (Koichi Sasada) over 13 years ago Actions #1

  • Tracker changed from Backport to Feature
  • Project changed from 15 to Ruby
  • Assignee set to nobu (Nobuyoshi Nakada)

Backport from where?

Order is:
(1) Modify trunk
(2) Backport to 2.0.0

BTW, I +1 for this proposal.

Updated by marcandre (Marc-Andre Lafortune) over 13 years ago Actions #2

  • Tracker changed from Feature to Bug

Moving to bug.

def foo x, opt:42; end # => ok
def foo    opt:42; end # => syntax error, should be ok
def foo(   opt:42); end # => ok

Updated by ko1 (Koichi Sasada) over 13 years ago Actions #3 [ruby-core:52908]

  • Category set to core
  • Target version set to 2.1.0
  • ruby -v set to -v

Updated by nobu (Nobuyoshi Nakada) over 13 years ago Actions #4

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

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


parse.y: keyword argument without paren

  • parse.y (IS_LABEL_POSSIBLE): allow labels for keyword arguments just
    after method definition without a parenthesis. [ruby-core:52820]
    [Bug #7942]

Updated by nobu (Nobuyoshi Nakada) over 13 years ago Actions #5

  • Tracker changed from Bug to Backport
  • Project changed from Ruby to 15
  • Category deleted (core)
  • Status changed from Closed to Assigned
  • Assignee changed from nobu (Nobuyoshi Nakada) to nagachika (Tomoyuki Chikanaga)
  • Target version deleted (2.1.0)

Updated by nobu (Nobuyoshi Nakada) over 13 years ago Actions #6

  • Subject changed from keyword arguments must use with quot? to keyword arguments must use with paren?

Updated by nagachika (Tomoyuki Chikanaga) over 13 years ago Actions #7

  • Status changed from Assigned to Closed

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


merge revision(s) 39504: [Backport #7942]

* parse.y (IS_LABEL_POSSIBLE): allow labels for keyword arguments just
  after method definition without a parenthesis.  [ruby-core:52820]
  [Bug #7942]
Actions

Also available in: PDF Atom