Commit 7e10664e authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Instroduced TranslationUnit::spell(tokenIndex).

parent 764379de
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment