* lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Improve precedences
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 8 Nov 2013 02:31:51 +0000 (04:31 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 8 Nov 2013 02:31:51 +0000 (04:31 +0200)
commit1f9239238301d92e539260f908916d3c188ffead
tree91403fcf32c6de09096842d8f95871726203950e
parent5ee2921081ec21d18b1a190bdacb3ebd3bfdc294
* lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Improve precedences
of "and", "or", "&&" and "||".
(ruby-smie--args-separator-p): Prohibit keyword "do" as the first
argument.  Prohibit opening curly brace because it could only be a
block opener in that position.
(ruby-smie--forward-token, ruby-smie--backward-token): Separate
"|" from "&" or "*" going after it.  That can happen in block
arguments.
(ruby-smie--indent-to-stmt): New function, seeks the end of
previous statement or beginning of buffer.
(ruby-smie-rules): Use it.
(ruby-smie-rules): Check if there's a ":" before a curly block
opener candidate; if there is, it's a hash.

* test/indent/ruby.rb: New examples.
lisp/ChangeLog
lisp/progmodes/ruby-mode.el
test/ChangeLog
test/indent/ruby.rb