[Top][All Lists]

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

Re: Help sought from C++ expert: is this `value' a type or something els

From: Óscar Fuentes
Subject: Re: Help sought from C++ expert: is this `value' a type or something else (what)?
Date: Thu, 19 Jan 2023 17:22:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Alan Mackenzie <acm@muc.de> writes:

> Hello, Emacs.
> In the following test file, templates-9.cc from the CC Mode test suite,
> on the indicated line, what is the syntactic significance of `value'?
> Traditionally, it has fontified with the default face, but recently after
> some (not yet committed) changes in CC Mode, it has started getting
> font-lock-type-face.
> I don't understand the file at all, hardly, and can't work out whether
> the old (non-) fontification was correct, or whether the new
> fontification of f-l-type-face is correct.  Help would be appreciated.
> Just as a matter of interest, in c++-ts-mode a treesit-query-error gets
> thrown.  It isn't clear to me whether the file is still valid C++.

It is not valid C++ because it misses quite a few declarations.

The parser has no way of knowing what `value' is unless it can see the
relevant declarations. And even then, in the general case, it is not
possible to really know unless your "parser" is, actually, a C++ front
end. So both c++-mode and c++-ts-mode are out of their breadth here.

IMAO, a reasonable heuristic is to consider it a value unless it is
preceded by `typename'.

reply via email to

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