[Top][All Lists]

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

bug#15594: trunk r114639: * lisp/progmodes/ruby-mode.el (ruby-smie-gramm

From: Dmitry Gutov
Subject: bug#15594: trunk r114639: * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Add rule for paren-free
Date: Sat, 26 Oct 2013 05:19:03 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

On 21.10.2013 17:25, Stefan Monnier wrote:
Calling ruby-smie--forward-token is a bit dangerous since that function
might itself be called from ruby-smie--forward-token.  It might work,
but you'll have to think hard about why an inf-loop is not possible.
Hopefully because both `ruby-smie--forward-token' and
ruby-smie--backward-token' would only call `ruby-smie--forward-token', and
only when (> pos (point)), IOW there has to be some whitespace skipping done
between the recursive calls.

Only recursing in one direction (only forward or only backward) is
a good way to guarantee progress, indeed.  But currently
ruby-smie--implicit-semi-p calls ruby-smie--backward-token, so beware.

That's a good point. And this would probably be more expensive approach, so I went with local search, for now.

reply via email to

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