Re: [LTP] [PATCH 0/7] docparse improvements

Richard Palethorpe
2021-10-27T13:41:34Z

Hello,

Cyril Hrubis <chrubis@suse.cz> writes:

> Implement support for various missing bits to the docparse tool and
> enables it unconditionally so that the metadata.json file is present on
> all builds.
>
> This is first part of bigger effort to get the metadata useful for the
> testrunners, expecially we need the .test_variants field to be properly
> parsed in order to compute the overall test runtime correctly.

It's unfortunate that before starting this effort and the checker that
we didn't know about tree-sitter (although Sparse may still be the best
choice for the checker).

Tree-sitter can parse C into an AST and can easily be vendored into LTP:
https://tree-sitter.github.io/tree-sitter/using-parsers#building-the-library

Then we just need to work on the level of the AST. It also has a query
language. This should allow the initial matching to be done on a high
level.

If we continue down the path of hand parsing C, then it will most likely
result in constant tweaks and additions.

--
Thank you,
Richard.