[cfe-dev] [RFC] A C++ pseudo parser for tooling

James Y Knight via cfe-dev cfe-dev at lists.llvm.org
Tue Nov 9 07:20:48 PST 2021


On Mon, Nov 8, 2021, 9:41 PM Andrew Tomazos via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> On Mon, Nov 8, 2021 at 11:18 AM Haojian Wu <hokein at google.com> wrote:
>
>> IDE use cases (for clangd)
>> -  provide code-folding, outline, syntax highlighting, selection features
>> without a long "warmup" time;
>> -  a fast index to provides approximate results;
>>
>> Other use cases we aim to support:
>> - smart diff and merge tool for C++ code;
>> - a fast linter, a cpplint replacement, with clang-tidy-like
>> extensibility;
>> - syntactic grep/sed tools;
>>
>
> * Syntax highlighting is the only use case of those listed that can
> tolerate inaccuracy.
>

That's definitely not true. I use "etags" quite regularly as a quick code
index, for example. I use "git grep" regularly as a symbol reference
"index". My editor matches curly braces to find the bounds of a block,
completely ignoring the fact that someone might have done "#define END }".
I use diff/merge tools that completely ignore C syntax clues, and run sed
to make global changes in c++ projects.

These existing tools are all quite far from accurate, yet they all work
well enough to be extremely useful -- and, most importantly, they work
without building intermediate artifacts, or doing any build system
integration. If this new project can do a better job than these tools, and
keep the same simplicity of use, it sounds like a win to me!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211109/a1a70235/attachment.html>


More information about the cfe-dev mailing list