4 ms·
You can ask Clang for an AST that contains macro definitions and invocations as nodes. https://docs.rs/clang/latest/clang/struct.Parser.html#method.detailed_pr
by yencabulator 2y ago
You can ask Clang for an AST that contains macro definitions and invocations as nodes.
https://docs.rs/clang/latest/clang/struct.Parser.html#method.detailed_preprocessing_record https://docs.rs/clang/latest/clang/struct.Parser.html#method...
https://docs.rs/clang/latest/clang/enum.EntityKind.html#variant.MacroExpansion https://docs.rs/clang/latest/clang/enum.EntityKind.html#vari...
https://docs.rs/clang/latest/clang/enum.EntityKind.html#variant.MacroDefinition https://docs.rs/clang/latest/clang/enum.EntityKind.html#vari...
- Sesse__ 2y agoUsing clangd for this very much assumes that you have all include files and build flags available at the point of merge resolution, which is often pretty much impossible.
- yencabulator 2y agoAgreed, it's not very robust the way tree-sitter is. I just thought that libclang trick was very useful for extracting semantic information from C source.