ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
@ 2022-06-26 13:06 qnighy (Masaki Hara)
  2022-06-27 16:48 ` [ruby-core:109074] " lhmzhou (Linda Zhou)
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: qnighy (Masaki Hara) @ 2022-06-26 13:06 UTC (permalink / raw)
  To: ruby-core

Issue #18878 has been reported by qnighy (Masaki Hara).

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878

* Author: qnighy (Masaki Hara)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
The following source doesn't parse:

```ruby
Foo::Bar {}
```

despite the following:

```ruby
bar           # local variable or method call
Bar           # constant
bar()         # method call
Bar()         # method call
bar {}        # method call
Bar {}        # method call
bar() {}      # method call
Bar() {}      # method call
Foo::bar      # method call
Foo::Bar      # constant
Foo::bar()    # method call
Foo::Bar()    # method call
Foo::bar {}   # method call
# Foo::Bar {} # SyntaxError
Foo::bar() {} # method call
Foo::Bar() {} # method call
```

Especially considering `Bar {}`, this looks like a missing implementation rather than an intentional behavior.



-- 
https://bugs.ruby-lang.org/

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

* [ruby-core:109074] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
@ 2022-06-27 16:48 ` lhmzhou (Linda Zhou)
  2022-06-28  3:38 ` [ruby-core:109076] " qnighy (Masaki Hara)
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: lhmzhou (Linda Zhou) @ 2022-06-27 16:48 UTC (permalink / raw)
  To: ruby-core

Issue #18878 has been updated by lhmzhou (Linda Zhou).


Is there a more descriptive error message, or is `SyntaxError` the only output provided?

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-98219

* Author: qnighy (Masaki Hara)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
The following source doesn't parse:

```ruby
Foo::Bar {}
```

despite the following:

```ruby
bar           # local variable or method call
Bar           # constant
bar()         # method call
Bar()         # method call
bar {}        # method call
Bar {}        # method call
bar() {}      # method call
Bar() {}      # method call
Foo::bar      # method call
Foo::Bar      # constant
Foo::bar()    # method call
Foo::Bar()    # method call
Foo::bar {}   # method call
# Foo::Bar {} # SyntaxError
Foo::bar() {} # method call
Foo::Bar() {} # method call
```

Especially considering `Bar {}`, this looks like a missing implementation rather than an intentional behavior.



-- 
https://bugs.ruby-lang.org/

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

* [ruby-core:109076] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
  2022-06-27 16:48 ` [ruby-core:109074] " lhmzhou (Linda Zhou)
@ 2022-06-28  3:38 ` qnighy (Masaki Hara)
  2023-08-30 20:26 ` [ruby-core:114598] " jeremyevans0 (Jeremy Evans) via ruby-core
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: qnighy (Masaki Hara) @ 2022-06-28  3:38 UTC (permalink / raw)
  To: ruby-core

Issue #18878 has been updated by qnighy (Masaki Hara).


> Is there a more descriptive error message, or is `SyntaxError` the only output provided?

This is the actual error message:

```
% ruby -e 'Foo::Bar {}'
-e:1: syntax error, unexpected '{'
Foo::Bar {}
```

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-98222

* Author: qnighy (Masaki Hara)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
The following source doesn't parse:

```ruby
Foo::Bar {}
```

despite the following:

```ruby
bar           # local variable or method call
Bar           # constant
bar()         # method call
Bar()         # method call
bar {}        # method call
Bar {}        # method call
bar() {}      # method call
Bar() {}      # method call
Foo::bar      # method call
Foo::Bar      # constant
Foo::bar()    # method call
Foo::Bar()    # method call
Foo::bar {}   # method call
# Foo::Bar {} # SyntaxError
Foo::bar() {} # method call
Foo::Bar() {} # method call
```

Especially considering `Bar {}`, this looks like a missing implementation rather than an intentional behavior.



-- 
https://bugs.ruby-lang.org/

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

* [ruby-core:114598] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
  2022-06-27 16:48 ` [ruby-core:109074] " lhmzhou (Linda Zhou)
  2022-06-28  3:38 ` [ruby-core:109076] " qnighy (Masaki Hara)
@ 2023-08-30 20:26 ` jeremyevans0 (Jeremy Evans) via ruby-core
  2025-03-21  4:46 ` [ruby-core:121420] [Ruby " qnighy (Masaki Hara) via ruby-core
  2025-05-07  6:07 ` [ruby-core:121872] " mame (Yusuke Endoh) via ruby-core
  4 siblings, 0 replies; 6+ messages in thread
From: jeremyevans0 (Jeremy Evans) via ruby-core @ 2023-08-30 20:26 UTC (permalink / raw)
  To: ruby-core; +Cc: jeremyevans0 (Jeremy Evans)

Issue #18878 has been updated by jeremyevans0 (Jeremy Evans).


It looks like this will be fixed by YARP:

```
$ ruby -r yarp -e "pp YARP.parse('Foo::Bar {}')"
#<YARP::ParseResult:0x00000b1512acc448
 @comments=[],
 @errors=[],
 @source=#<YARP::Source:0x00000b14749d6690 @offsets=[0], @source="Foo::Bar {}">,
 @value=
  ProgramNode(0...11)(
    [],
    StatementsNode(0...11)(
      [CallNode(0...11)(ConstantReadNode(0...3)(), (3...5), (5...8), nil, nil, nil, BlockNode(9...11)([], nil, nil, (9...10), (10...11)), 0, "Bar")]
    )
  ),
 @warnings=[]>
```

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-104415

* Author: qnighy (Masaki Hara)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
The following source doesn't parse:

```ruby
Foo::Bar {}
```

despite the following:

```ruby
bar           # local variable or method call
Bar           # constant
bar()         # method call
Bar()         # method call
bar {}        # method call
Bar {}        # method call
bar() {}      # method call
Bar() {}      # method call
Foo::bar      # method call
Foo::Bar      # constant
Foo::bar()    # method call
Foo::Bar()    # method call
Foo::bar {}   # method call
# Foo::Bar {} # SyntaxError
Foo::bar() {} # method call
Foo::Bar() {} # method call
```

Especially considering `Bar {}`, this looks like a missing implementation rather than an intentional behavior.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

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

* [ruby-core:121420] [Ruby Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
                   ` (2 preceding siblings ...)
  2023-08-30 20:26 ` [ruby-core:114598] " jeremyevans0 (Jeremy Evans) via ruby-core
@ 2025-03-21  4:46 ` qnighy (Masaki Hara) via ruby-core
  2025-05-07  6:07 ` [ruby-core:121872] " mame (Yusuke Endoh) via ruby-core
  4 siblings, 0 replies; 6+ messages in thread
From: qnighy (Masaki Hara) via ruby-core @ 2025-03-21  4:46 UTC (permalink / raw)
  To: ruby-core; +Cc: qnighy (Masaki Hara)

Issue #18878 has been updated by qnighy (Masaki Hara).


Now `Foo::Bar {}` parses in parse.y too, but `Foo::Bar {} + 1` still doesn't parse unlike in Prism.

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-112403

* Author: qnighy (Masaki Hara)
* Status: Open
* ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
The following source doesn't parse:

```ruby
Foo::Bar {}
```

despite the following:

```ruby
bar           # local variable or method call
Bar           # constant
bar()         # method call
Bar()         # method call
bar {}        # method call
Bar {}        # method call
bar() {}      # method call
Bar() {}      # method call
Foo::bar      # method call
Foo::Bar      # constant
Foo::bar()    # method call
Foo::Bar()    # method call
Foo::bar {}   # method call
# Foo::Bar {} # SyntaxError
Foo::bar() {} # method call
Foo::Bar() {} # method call
```

Especially considering `Bar {}`, this looks like a missing implementation rather than an intentional behavior.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

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

* [ruby-core:121872] [Ruby Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected
  2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
                   ` (3 preceding siblings ...)
  2025-03-21  4:46 ` [ruby-core:121420] [Ruby " qnighy (Masaki Hara) via ruby-core
@ 2025-05-07  6:07 ` mame (Yusuke Endoh) via ruby-core
  4 siblings, 0 replies; 6+ messages in thread
From: mame (Yusuke Endoh) via ruby-core @ 2025-05-07  6:07 UTC (permalink / raw)
  To: ruby-core; +Cc: mame (Yusuke Endoh)

Issue #18878 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned
Assignee set to ydah (Yudai Takada)

----------------------------------------
Bug #18878: parse.y: Foo::Bar {} is inconsistently rejected
https://bugs.ruby-lang.org/issues/18878#change-112939

* Author: qnighy (Masaki Hara)
* Status: Assigned
* Assignee: ydah (Yudai Takada)
* ruby -v: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
The following source doesn't parse:

```ruby
Foo::Bar {}
```

despite the following:

```ruby
bar           # local variable or method call
Bar           # constant
bar()         # method call
Bar()         # method call
bar {}        # method call
Bar {}        # method call
bar() {}      # method call
Bar() {}      # method call
Foo::bar      # method call
Foo::Bar      # constant
Foo::bar()    # method call
Foo::Bar()    # method call
Foo::bar {}   # method call
# Foo::Bar {} # SyntaxError
Foo::bar() {} # method call
Foo::Bar() {} # method call
```

Especially considering `Bar {}`, this looks like a missing implementation rather than an intentional behavior.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

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

end of thread, other threads:[~2025-05-07  6:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-26 13:06 [ruby-core:109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected qnighy (Masaki Hara)
2022-06-27 16:48 ` [ruby-core:109074] " lhmzhou (Linda Zhou)
2022-06-28  3:38 ` [ruby-core:109076] " qnighy (Masaki Hara)
2023-08-30 20:26 ` [ruby-core:114598] " jeremyevans0 (Jeremy Evans) via ruby-core
2025-03-21  4:46 ` [ruby-core:121420] [Ruby " qnighy (Masaki Hara) via ruby-core
2025-05-07  6:07 ` [ruby-core:121872] " mame (Yusuke Endoh) via ruby-core

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).