[cfe-dev] SourceRange extents and tokenization

Sean Heelan seanheelan at gmail.com
Tue Jul 10 13:36:02 PDT 2012


Hey,

Are the bounds of a SourceRange meant to be inclusive of whatever
source location is indicated by the 'end' value? I ask because I have
a cursor for the string literal "xyz" in a call like 'func("xyz", 1)'
and the range associated with this cursor is (5, 10), if we say 'f' is
at 0. Index 10 is the index of the ','  after the string literal. This
leads to the odd situation whereby calling clang_tokenize on the
source range generates two tokens. One for the string literal and one
for the trailing comma.

Is this expected behaviour?

Cheers,
Sean



More information about the cfe-dev mailing list