diff options
| author | Dmitry Gutov | 2013-10-22 02:25:59 +0400 |
|---|---|---|
| committer | Dmitry Gutov | 2013-10-22 02:25:59 +0400 |
| commit | 18cacc392d076dfd78b58e842116c0c578aaf3c7 (patch) | |
| tree | 49c2ef2ee1f7d002025ecc5ed9364ac1271a0c44 /test | |
| parent | 1257317a7c3d4052a6c43f2774cd0a6c6057d420 (diff) | |
| download | emacs-18cacc392d076dfd78b58e842116c0c578aaf3c7.tar.gz emacs-18cacc392d076dfd78b58e842116c0c578aaf3c7.zip | |
* lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Remove outdated
TODO. Add "." after " @ ".
(ruby-smie--at-dot-call): New function. Checks if point at method
call with explicit target.
(ruby-smie--forward-token, ruby-smie--backward-token): Prepend "."
to the method name tokens when it precedes them.
(ruby-smie--backward-id, ruby-smie--forward-id): Remove.
(ruby-smie-rules): Add rule for indentation before and after "."
token.
Diffstat (limited to 'test')
| -rw-r--r-- | test/indent/ruby.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index c9ec8bd3723..5c47eea0baf 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb | |||
| @@ -189,15 +189,16 @@ end | |||
| 189 | foo + | 189 | foo + |
| 190 | bar | 190 | bar |
| 191 | 191 | ||
| 192 | foo_bar_tee(1, 2, 3) | ||
| 193 | .qux | ||
| 194 | .bar | ||
| 195 | |||
| 192 | # Examples below still fail with `ruby-use-smie' on: | 196 | # Examples below still fail with `ruby-use-smie' on: |
| 193 | 197 | ||
| 194 | foo = [1, 2, 3].map do |i| | 198 | foo = [1, 2, 3].map do |i| |
| 195 | i + 1 | 199 | i + 1 |
| 196 | end | 200 | end |
| 197 | 201 | ||
| 198 | foo_bar_tee(1, 2, 3) | ||
| 199 | .qux | ||
| 200 | |||
| 201 | method !arg1, | 202 | method !arg1, |
| 202 | arg2 | 203 | arg2 |
| 203 | 204 | ||
| @@ -209,3 +210,13 @@ method :foo, | |||
| 209 | 210 | ||
| 210 | method (a + b), | 211 | method (a + b), |
| 211 | c | 212 | c |
| 213 | |||
| 214 | foo do | ||
| 215 | bar | ||
| 216 | .tee | ||
| 217 | end | ||
| 218 | |||
| 219 | def bar | ||
| 220 | foo | ||
| 221 | .baz | ||
| 222 | end | ||