GNU bug report logs - #15594
24.3; Indentation of method arguments without parentheses in ruby-mode is broken

Previous Next

Package: emacs;

Reported by: Bozhidar Batsov <bozhidar.batsov <at> gmail.com>

Date: Sat, 12 Oct 2013 06:26:02 UTC

Severity: normal

Found in version 24.3

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 15594 <at> debbugs.gnu.org (full text, mbox):

From: Bozhidar Batsov <bozhidar.batsov <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 15594 <at> debbugs.gnu.org
Subject: Re: bug#15594: 24.3; Indentation of method arguments without
 parentheses in ruby-mode is broken
Date: Sat, 12 Oct 2013 17:44:11 +0300
[Message part 1 (text/plain, inline)]
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 

[Message part 2 (text/html, inline)]

This bug report was last modified 11 years and 207 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.