[Top][All Lists]

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

Re: etags failing with structure members

From: Alan Mackenzie
Subject: Re: etags failing with structure members
Date: Sun, 12 Mar 2017 14:27:34 +0000
User-agent: Mutt/1.7.2 (2016-11-26)

Hello, Eli.

On Sat, Mar 11, 2017 at 13:24:26 +0200, Eli Zaretskii wrote:
> > Date: Sat, 11 Mar 2017 11:27:48 +0100
> > From: martin rudalics <address@hidden>
> > CC: address@hidden

> >  > the tricky macro syntax used by some of the
> >  > header files run afoul of the etags parsing.  I tried once to find a
> >  > solution for that, I might look into this again.

> > Can you explain with a few words why the macro syntax interferes?

> They look like a beginning of a K&R style function definition:

>   foo (bar, baz)
>     type1 bar;
>     type2 baz;

> This tricks etags into the state where it looks for the end of the
> function, and ignores everything until that point.

> One possible remedy would be to teach etags about the special macro
> ENUM_BF; I will look into that when I have time.  But there's trickier
> stuff in lisp.h that won't be helped even by that.

For what it's worth, CC Mode also suffers from K&R declarations.  It's a
shame that K and R didn't get this right in the initial version of C,
but considering everything, they did a splendid job.

CC Mode's current heuristic (see c-in-knr-argdecl in cc-engine.el) is to
check rigorously things like the absence of a ';' after the arglist, and
that the contents of the arglist is a simple comma separated list of
identifiers.  To solve a bug a year or two ago, it now also checks that
each identifier declared in the "k&r region" appears in the arglist.

I don't know how practical it would be to do all this in etags.

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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