Project

General

Profile

Actions

Feature #14463

open

Allow comments to precede dots in member expressions

Added by isiahmeadows (Isiah Meadows) almost 7 years ago. Updated almost 3 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:85496]

Description

I, coming from other languages, find it extremely odd that the first three are considered valid, but the fourth is a syntax error (tested in Ruby 2.3.4 + 2.5.0, Rubocop's parser for 2.3):

# 1
foo = -> {}
foo.
  call

# 2
foo = -> {}
foo.
  # comment
  call

# 3
foo = -> {}
foo
  .call

# 4
foo = -> {}
foo
  # comment
  .call

Any chance 4 could be fixed? (It looks more like a parser/spec bug than anything.)


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #7639: More freedom for location of commentsClosedmatz (Yukihiro Matsumoto)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0