[cfe-dev] Function Rewriting

Alexei Svitkine alexei.svitkine at gmail.com
Tue Aug 11 09:16:09 PDT 2009


FYI: In case you haven't found it yet, the function is
clang::Lexer::MeasureTokenLength().

-Alexei

2009/8/11 Makslane Araújo Rodrigues <makslane at hotmail.com>:
> I will, thanks !
>
>> Date: Tue, 11 Aug 2009 16:16:18 +0200
>> From: cedric.venet at laposte.net
>> To: makslane at hotmail.com
>> CC: cfe-dev at cs.uiuc.edu
>> Subject: Re: [cfe-dev] Function Rewriting
>>
>>
>> >
>> > "loc" is the location of the start of the identifier, not the location
>> > of the end of the parameter declaration; thus when you insert at that
>> > point, it inserts before the variable name. You want to insert after
>> > the end of the variable declaration; unfortunately, it looks like
>> > that location just isn't preserved in the AST. That's definitely
>> > worth filing a bug about.
>>
>> I didn't respond earlier because I do not remember exactly the function
>> to use. I do not think this is a bug, but a design decision. it is
>> always only the start which is in the AST (for single token construct at
>> least), to get the end of the token, use a Lex function lextoken or
>> something like this. However, this is just my understanding. you can
>> check how the caret diagnostic are generated, it will show you the good
>> way to do what you want.
>>
>> regards,
>>
>> Cédric.
>
> ________________________________
> Instale o novo Internet Explorer 8 versão especial para o MSN. Download aqui
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>




More information about the cfe-dev mailing list