Closed deadlocklogic closed 2 years ago
Fixed the issue, thanks for reporting.
Why you haven't considered adding line info to cpp_entity
I didn't need it when I wrote cppast initially. Feel free to do a PR, I'm giving some pointers in #105.
Why not adding a cpp_comment entity for non-docs comment.
Ideologically: comments shouldn't contain semantic information, use doc comments or custom attributes instead.
If you need it, it should be enough to just adjust the logic here https://github.com/foonathan/cppast/blob/34e7bb4bf4a6e0d5ce80001dd12ee6b0c4b0b384/src/libclang/preprocessor.cpp#L806 and here https://github.com/foonathan/cppast/blob/34e7bb4bf4a6e0d5ce80001dd12ee6b0c4b0b384/src/libclang/preprocessor.cpp#L739. If you want to do a PR, please add a flag to control the comment behavior.
Basically, in my case I my using this library for reflection/binding generation and it works perfectly. But I was considering using it as a code generator in which case I need line infos in order to be able to modify original source. By the way I already created binding to this library for lua and python and I am working for one for javascript/nodejs which I will release soon.
I saw someone in late issue tracker, doing a PR addressing line infos and dunno what happened back then but I think this should be straight forward.
libclang_parser
Explanation of the error.
Input:
Output: This prints
std::vector<T
notice the missing
>Side questions:
cpp_entity
cpp_comment
entity for non-docs comment.Thanks