* bug#15594: 24.3; Indentation of method arguments without parentheses in ruby-mode is broken @ 2013-10-12 6:24 Bozhidar Batsov 2013-10-12 14:37 ` Stefan Monnier 0 siblings, 1 reply; 4+ messages in thread From: Bozhidar Batsov @ 2013-10-12 6:24 UTC (permalink / raw) To: 15594 [-- Attachment #1: Type: text/plain, Size: 495 bytes --] In Ruby one can invoke methods with or without parentheses: some_method(arg1, arg2) some_method arg1, arg2 ruby-mode currently does not handle properly the indentation of calls without parentheses that span several lines: # indented properly in 24.3 some_method(arg1, arg2) # not indented at all in 24.3 some_method arg1, arg2 Ideally the second code example would be indented by ruby-mode like this: some_method arg1, arg2 -- Cheers, Bozhidar [-- Attachment #2: Type: text/html, Size: 1618 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#15594: 24.3; Indentation of method arguments without parentheses in ruby-mode is broken 2013-10-12 6:24 bug#15594: 24.3; Indentation of method arguments without parentheses in ruby-mode is broken Bozhidar Batsov @ 2013-10-12 14:37 ` Stefan Monnier 2013-10-12 14:44 ` Bozhidar Batsov 0 siblings, 1 reply; 4+ messages in thread From: Stefan Monnier @ 2013-10-12 14:37 UTC (permalink / raw) To: Bozhidar Batsov; +Cc: 15594 > 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 -- Stefan ^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#15594: 24.3; Indentation of method arguments without parentheses in ruby-mode is broken 2013-10-12 14:37 ` Stefan Monnier @ 2013-10-12 14:44 ` Bozhidar Batsov 2013-10-12 20:41 ` Stefan Monnier 0 siblings, 1 reply; 4+ messages in thread From: Bozhidar Batsov @ 2013-10-12 14:44 UTC (permalink / raw) To: Stefan Monnier; +Cc: 15594 [-- Attachment #1: Type: text/plain, Size: 949 bytes --] 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 [-- Attachment #2: Type: text/html, Size: 2162 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#15594: 24.3; Indentation of method arguments without parentheses in ruby-mode is broken 2013-10-12 14:44 ` Bozhidar Batsov @ 2013-10-12 20:41 ` Stefan Monnier 0 siblings, 0 replies; 4+ messages in thread From: Stefan Monnier @ 2013-10-12 20:41 UTC (permalink / raw) To: Bozhidar Batsov; +Cc: 15594-done >> > In Ruby one can invoke methods with or without parentheses: >> > some_method(arg1, arg2) >> > some_method arg1, arg2 I just added some support for it, thank you, Stefan ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-12 20:41 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-10-12 6:24 bug#15594: 24.3; Indentation of method arguments without parentheses in ruby-mode is broken Bozhidar Batsov 2013-10-12 14:37 ` Stefan Monnier 2013-10-12 14:44 ` Bozhidar Batsov 2013-10-12 20:41 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).