[cfe-dev] libclang interface for comments AST

Douglas Gregor dgregor at apple.com
Tue Jul 17 13:07:58 PDT 2012


On Jul 17, 2012, at 12:01 PM, Jacob Carlborg <doob at me.com> wrote:

> 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?

I intended to suggest that we want both APIs.

	- Doug



More information about the cfe-dev mailing list