Project

General

Profile

Feature #14463

Allow comments to precede dots in member expressions

Added by isiahmeadows (Isiah Meadows) 7 days ago. Updated 4 days ago.

Status:
Open
Priority:
Normal
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

Related to Ruby trunk - Feature #7639: More freedom for location of commentsFeedback2012-12-31

History

#1 Updated by duerst (Martin Dürst) 4 days ago

  • Related to Feature #7639: More freedom for location of comments added

#2 [ruby-core:85541] Updated by duerst (Martin Dürst) 4 days ago

There is extensive discussion on this at #7636. Please check.

Also available in: Atom PDF