From: Bozhidar Batsov <bozhidar.batsov@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 15594@debbugs.gnu.org
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 [thread overview]
Message-ID: <B3B050DFD90543DE9EE66D81A9CB8DD9@gmail.com> (raw)
In-Reply-To: <jwvbo2usgit.fsf-monnier+emacsbugs@gnu.org>
[-- 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 --]
next prev parent reply other threads:[~2013-10-12 14:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2013-10-12 20:41 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=B3B050DFD90543DE9EE66D81A9CB8DD9@gmail.com \
--to=bozhidar.batsov@gmail.com \
--cc=15594@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).