emacs-devel
[Top][All Lists]
Advanced

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

Re: trunk r114639: * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Ad


From: Dmitry Gutov
Subject: Re: trunk r114639: * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Add rule for paren-free
Date: Mon, 14 Oct 2013 05:06:38 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi Stefan,

thanks for starting on this feature. Comments and questions follow.

> revno: 114639
> revision-id: address@hidden
> parent: address@hidden
> committer: Stefan Monnier <address@hidden>
> branch nick: trunk
> timestamp: Sat 2013-10-12 16:40:50 -0400

> ...

> +(defun ruby-smie--args-separator-p (pos)
> +  (and
> +   (eq ?w (char-syntax (char-before)))
> +   (< pos (point-max))
> +   (memq (char-syntax (char-after pos)) '(?w ?\"))))

I've made a change to the first condition in 114655, but the last line
is still very inadequate.

The first argument can be any kind of literal, parenthesized expression,
or even (if we want to get fancy) something like `begin foo; bar end'.
(See new examples is indent/ruby.rb).

So basically, I think we'd like to check if the token following POS is
either not "special", or if it is, it begins an expression. Can we do
that?

> === modified file 'test/indent/ruby.rb'
> --- a/test/indent/ruby.rb     2013-10-11 20:45:14 +0000
> +++ b/test/indent/ruby.rb     2013-10-12 20:40:50 +0000
> @@ -170,3 +170,7 @@
>  if foo &&
>      bar
>  end
> +
> +method1 arg1,                   # bug#15594
> +        method2 arg2,
> +                arg3

Please note that you've added the example to the "currently failing"
part of the file. I've moved it now.



reply via email to

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