From b420ccfc4cbe081b53881a7c9f0dd6b778b99b99 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 7 Nov 2013 03:58:12 +0200 Subject: [PATCH] * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Lower priority of "." compared to "do". --- lisp/ChangeLog | 5 +++++ lisp/progmodes/ruby-mode.el | 2 +- test/indent/ruby.rb | 4 +--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index be01a0cdc2..bbd86b51bc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-11-07 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-smie-grammar): Lower priority of + "." compared to "do". + 2013-11-06 Glenn Morris * Makefile.in (setwins_almost, setwins_for_subdirs): diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 253a600605..b502034487 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -280,7 +280,7 @@ explicitly declared in magic comment." (inst (exp) (inst "iuwu-mod" exp)) (exp (exp1) (exp "," exp) (exp "=" exp) (id " @ " exp) - (exp "." exp)) + (exp "." id)) (exp1 (exp2) (exp2 "?" exp1 ":" exp1)) (exp2 ("def" insts "end") ("begin" insts-rescue-insts "end") diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 5e3db5afb7..3d881edcba 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb @@ -238,12 +238,10 @@ foo :bar do qux end -# Examples below still fail with `ruby-use-smie' on: - foo = [1, 2, 3].map do |i| i + 1 end -bar.foo do # "." is parent to "do"; it shouldn't be. +bar.foo do bar end -- 2.20.1