[cfe-dev] libclang interface for comments AST
Jacob Carlborg
doob at me.com
Tue Jul 17 12:01:57 PDT 2012
On 2012-07-17 18:54, Douglas Gregor wrote:
> This group of functions:
>
> +CINDEX_LINKAGE CXString clang_HTMLTagComment_getTagName(CXComment Comment);
> +CINDEX_LINKAGE
> +unsigned clang_HTMLStartTagComment_isSelfClosing(CXComment Comment);
> +CINDEX_LINKAGE unsigned clang_HTMLStartTag_getNumAttrs(CXComment Comment);
> +CINDEX_LINKAGE
> +CXString clang_HTMLStartTag_getAttrName(CXComment Comment, unsigned AttrIdx);
> +CINDEX_LINKAGE
> +CXString clang_HTMLStartTag_getAttrValue(CXComment Comment, unsigned AttrIdx);
>
> implies that a client will have to reconstruct HTML tags on its own, which seems like it's going to cause a lot of redundant (and probably wrong) code in clients. Can the aforementioned clang_Comment_getText() do the right thing for CXComment_HTMLStartTag and CXComment_HTMLEndTag nodes, by formatting the HTML tag appropriately? That would simplify a number of clients.
I don't agree with this. Isn't the job of libclang to just provide the
data and then it's up to the client what to do with it?
I wouldn't want to get HTML back, I'm just interested in the data. I
have other plans for the data than transforming it to HTML.
What about providing API for doing both?
--
/Jacob Carlborg
More information about the cfe-dev
mailing list