[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
}
- ruby-mide, SMIE and token priority,
Dmitry Gutov <=
- Re: ruby-mide, SMIE and token priority, Stefan Monnier, 2013/11/06
- Re: ruby-mide, SMIE and token priority, Dmitry Gutov, 2013/11/07
- Re: ruby-mide, SMIE and token priority, Stefan Monnier, 2013/11/07
- Re: ruby-mide, SMIE and token priority, Bozhidar Batsov, 2013/11/11
- Re: ruby-mide, SMIE and token priority, Dmitry Gutov, 2013/11/11
- Re: ruby-mide, SMIE and token priority, Bozhidar Batsov, 2013/11/11
- Re: ruby-mide, SMIE and token priority, Dmitry Gutov, 2013/11/11