bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#15594: 24.3; Indentation of method arguments without parentheses in


From: Bozhidar Batsov
Subject: bug#15594: 24.3; Indentation of method arguments without parentheses in ruby-mode is broken
Date: Sat, 12 Oct 2013 17:44:11 +0300

On Saturday, October 12, 2013 at 5:37 PM, Stefan Monnier wrote:
In Ruby one can invoke methods with or without parentheses:
some_method(arg1, arg2)
some_method arg1, arg2

Interesting. How is the following parsed, then:

some_method arg1, other_method arg2, arg3, arg4
There are some limitations, of course. Ambiguous cases generally result in parsing errors:

Parser::CurrentRuby.parse('some_method arg1, other_method arg2, arg3, arg4')
(string):1:32: error: unexpected token tIDENTIFIER
some_method arg1, other_method arg2, arg3, arg4
                                                  ^^^^
Parser::SyntaxError: unexpected token tIDENTIFIER 

If we remove arg1, however, there is no ambiguity:

[21] pry(main)> Parser::CurrentRuby.parse('some_method other_method arg2, arg3, arg4')
=> (send nil :some_method
  (send nil :other_method
    (send nil :arg2)
    (send nil :arg3)
    (send nil :arg4)))


-- Stefan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]