forked from qt-creator/qt-creator
Instroduced TranslationUnit::spell(tokenIndex).
This commit is contained in:
@@ -77,12 +77,7 @@ int ASTVisitor::tokenKind(unsigned index) const
|
||||
{ return translationUnit()->tokenKind(index); }
|
||||
|
||||
const char *ASTVisitor::spell(unsigned index) const
|
||||
{
|
||||
if (! index)
|
||||
return 0;
|
||||
|
||||
return translationUnit()->tokenAt(index).spell();
|
||||
}
|
||||
{ return translationUnit()->spell(index); }
|
||||
|
||||
Identifier *ASTVisitor::identifier(unsigned index) const
|
||||
{ return translationUnit()->identifier(index); }
|
||||
|
@@ -134,6 +134,14 @@ const Token &TranslationUnit::tokenAt(unsigned index) const
|
||||
int TranslationUnit::tokenKind(unsigned index) const
|
||||
{ return _tokens->at(index).kind; }
|
||||
|
||||
const char *TranslationUnit::spell(unsigned index) const
|
||||
{
|
||||
if (! index)
|
||||
return 0;
|
||||
|
||||
return _tokens->at(index).spell();
|
||||
}
|
||||
|
||||
Identifier *TranslationUnit::identifier(unsigned index) const
|
||||
{ return _tokens->at(index).identifier; }
|
||||
|
||||
|
@@ -87,6 +87,7 @@ public:
|
||||
unsigned tokenCount() const;
|
||||
const Token &tokenAt(unsigned index) const;
|
||||
int tokenKind(unsigned index) const;
|
||||
const char *spell(unsigned index) const;
|
||||
|
||||
unsigned matchingBrace(unsigned index) const;
|
||||
Identifier *identifier(unsigned index) const;
|
||||
|
Reference in New Issue
Block a user