[ruby-core:69910] [CommonRuby - Feature #10528] Allow line breaks instead of commas in arrays, hashes, argument lists, etc.

From: 2851820660@...
Date: 2015-07-09 05:11:58 UTC
List: ruby-core #69910
Issue #10528 has been updated by 11 22.


http://www.software-rating.com/
http://www.smartlogi.com/  
http://www.shareorder.com/  
http://www.gzs168.com/  
http://www.aimooimage.com/    
http://www.chinatowngate.net/

http://www.inspiredhypnosis.co.uk/daocplat.html
http://the303plan.com/tibiagoldforsale.html

----------------------------------------
Feature #10528: Allow line breaks instead of commas in arrays, hashes, argument lists, etc.
https://bugs.ruby-lang.org/issues/10528#change-53329

* Author: Alexey Muranov
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Since the seemingly reasonable proposal #8956 has been rejected because it "diverged so far from the original", i will dare to propose another version here.

I suggest to automatically convert line breaks inside parentheses `(...)`, inside  "hashy" braces `{...}`, inside brackets `[...]`, and inside block argument lists `|...|`, if they are not preceded with a comma and skipping empty space, into a comma, while all other line breaks that are not preceded with a semicolon into a semicolon (skipping empty lines).  Unless, of course, the line break is preceded with `\` or followed by a dot `.`.

I would be possible to write then:

```ruby
todo = [ 'shopping'
         'cinema'
         'restaurant' ]

rules = { 'evil' => 'bad'
          'kind' => 'good' }
```



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

In This Thread

Prev Next