help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: SMIE examples or guides


From: Stefan Monnier
Subject: Re: SMIE examples or guides
Date: Fri, 01 Jul 2016 03:13:15 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> Many thanks! That appears to work. But there is one problem. In a
> buffer with just this content:

>     [
>     \
>     ]

> I get the error: (error "Bumped into unknown token")

You should either give a different syntax to the \ char in the
syntax-table, or change the :forward-token and :backward-token functions
so they do something with \

>       (smie-bnf->prec2
>        '((exp (("HELLO" "HALLO" "CIAO" "SALUT") exp "BYE"))))))

One way to do that is:

       (smie-bnf->prec2
        '((exp ("HELLO" exp "BYE")
               ("HALLO" exp "BYE")
               ("CIAO" exp "BYE")
               ("SALUT" exp "BYE"))))))

Another is to change the :forward-token and :backward-token functions so
they return the same string (e.g. "HELLO") when tokenizing any one of those.


        Stefan



reply via email to

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