emacs-devel
[Top][All Lists]
Advanced

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

Re: trunk r114534: Get Ruby's SMIE code to pass the test suite.


From: Stefan Monnier
Subject: Re: trunk r114534: Get Ruby's SMIE code to pass the test suite.
Date: Mon, 21 Oct 2013 12:46:17 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>> Maybe change the tokenizer so that a ".qux" *at smie-bolp* is tokenized
>> as "." and "qux"?
> That will probably break the following modified example:
> class C
>   def foo
>     self
>       .end
>     D.new
>      .class
>   end
> end

Yes, the problem is that the set of desired indentation does not match
the structure of a fixed parsing.  So, some of the differences need to
be handled in ad-hoc ways in the ruby-smie-rules function.

E.g. for (:before . ".") we'd have to look at the previous token and if
it's of the form "foo.bar", then manually align with the "." of
"foo.bar".

> But I guess we can make the tokenizer both return "." as a separate
> token and include it in the token that goes after it.

I'm not sure I understand exactly what you're suggesting, but I'd
venture to say that you can't do that.


        Stefan



reply via email to

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