Project

General

Profile

Actions

Bug #20675

open

Parse error with required kwargs and omitted parens

Added by matz (Yukihiro Matsumoto) about 6 hours ago.

Status:
Open
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.

No data to display

Actions

Also available in: Atom PDF

Like0