ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:52100] [Ruby master Bug#20675] Parse error with required kwargs and omitted parens
@ 2024-08-13  2:12 matz (Yukihiro Matsumoto) via ruby-dev
  2024-08-13 13:19 ` [ruby-dev:52101] " bkuhlmann (Brooke Kuhlmann) via ruby-dev
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: matz (Yukihiro Matsumoto) via ruby-dev @ 2024-08-13  2:12 UTC (permalink / raw)
  To: ruby-dev; +Cc: matz (Yukihiro Matsumoto)

Issue #20675 has been reported by matz (Yukihiro Matsumoto).

----------------------------------------
Bug #20675: Parse error with required kwargs and omitted parens
https://bugs.ruby-lang.org/issues/20675

* Author: matz (Yukihiro Matsumoto)
* Status: Open
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
As pointed out in https://github.com/mruby/mruby/issues/6268, keyword arguments without surrounding parens are a bit confusing, e.g.

```ruby
def foo arg:
  123
end
```

is parsed as

```ruby
def foo(arg:)
  123
end
```

where

```ruby
k=25
f k:
    10
```

is parserd as

```ruby
k=25
f(k: 10)
```

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

Matz.




-- 
https://bugs.ruby-lang.org/
_______________________________________________
ruby-dev mailing list -- ruby-dev@ml.ruby-lang.org
To unsubscribe send an email to ruby-dev-leave@ml.ruby-lang.org

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-09-05  5:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-13  2:12 [ruby-dev:52100] [Ruby master Bug#20675] Parse error with required kwargs and omitted parens matz (Yukihiro Matsumoto) via ruby-dev
2024-08-13 13:19 ` [ruby-dev:52101] " bkuhlmann (Brooke Kuhlmann) via ruby-dev
2024-08-14 19:27 ` [ruby-dev:52102] " Dan0042 (Daniel DeLorme) via ruby-dev
2024-08-15  2:16 ` [ruby-dev:52103] " ko1 (Koichi Sasada) via ruby-dev
2024-08-15 16:04 ` [ruby-dev:52104] " Dan0042 (Daniel DeLorme) via ruby-dev
2024-08-15 22:12 ` [ruby-dev:52105] " jeremyevans0 (Jeremy Evans) via ruby-dev
2024-08-16  8:43 ` [ruby-dev:52106] " ko1 (Koichi Sasada) via ruby-dev
2024-08-16 12:52 ` [ruby-dev:52107] " Dan0042 (Daniel DeLorme) via ruby-dev
2024-09-05  5:56 ` [ruby-dev:52111] " matz (Yukihiro Matsumoto) via ruby-dev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).