Project

General

Profile

Actions

Bug #20675

closed

Parse error with required kwargs and omitted parens

Added by matz (Yukihiro Matsumoto) 3 months ago. Updated 3 months ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-dev:<unknown>]

Description

As pointed out in https://github.com/mruby/mruby/issues/6268, keyword arguments without surrounding parens are a bit confusing, e.g.

def foo arg:
  123
end

is parsed as

def foo(arg:)
  123
end

where

k=25
f k:
    10

is parserd as

k=25
f(k: 10)

In summary, should we ignore newlines after keyword labels? Should we make them behave consistent?

Matz.

Actions

Also available in: Atom PDF

Like1
Like0Like1Like0Like0Like1Like0Like0Like0