emacs-devel
[Top][All Lists]
Advanced

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

ruby-mide, SMIE and token priority


From: Dmitry Gutov
Subject: ruby-mide, SMIE and token priority
Date: Thu, 07 Nov 2013 05:18:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

Stefan,

There's one example in indent/ruby.rb I don't know what to do about:

bar.foo(tee) do
  bar
end

The problem seems to be that "." is considered the parent token of "do". Probably because the left priority of "do" is not a number.

It would be more natural if the parent of "do" was ";" on the preceding line, instead. Is it at all possible to change the grammar this way?

Or should we just handle this as a special case in the `ruby-smie-rules', and in case of "do", instead of delegating to the parent, skip the parents until we find ";"?

P.S. And here's a similar example with a curly block:

bar.foo(tee) {
  bar
}



reply via email to

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