[Top][All Lists]

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


From: Stefan Monnier
Subject: Re: SMIE
Date: Wed, 27 Aug 2014 23:11:00 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> I know this is a long shot, but I am reading through ruby-mode.el's grammar
> table, and it uses the token "iuwu-mod" but I have no idea what that means.

The SMIE grammar does not use "keywords names" but "token names".
Most tokens represent a keyword and use the same name as that keyword,
but sometimes the same keyword is mapped to different tokens depending
on context.  That's what the *-forward-token and *-backward-token
functions are for.

If you look at ruby-smie--forward-token, for example, you'll see that it
can return "iuwu-mod" in the following case:

           ((member tok '("unless" "if" "while" "until"))
            (if (save-excursion (forward-word -1) (ruby-smie--bosp))
                tok "iuwu-mod"))

So I guess you can now guess what "iuwu" stands for.  As for the "mod",
it stands for "statement MODifier", IIRC.


reply via email to

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