AST: Tweaked debug output
This commit is contained in:
parent
c25ae59fbe
commit
7804b28e70
|
@ -1516,7 +1516,7 @@ static void astStringXml(const Token *tok, nonneg int indent, std::ostream &out)
|
|||
}
|
||||
}
|
||||
|
||||
void Token::printAst(bool verbose, bool xml, std::ostream &out) const
|
||||
void Token::printAst(bool verbose, bool xml, const std::vector<std::string> &fileNames, std::ostream &out) const
|
||||
{
|
||||
if (!xml)
|
||||
out << "\n\n##AST" << std::endl;
|
||||
|
@ -1534,7 +1534,7 @@ void Token::printAst(bool verbose, bool xml, std::ostream &out) const
|
|||
astStringXml(tok, 2U, out);
|
||||
out << "</ast>" << std::endl;
|
||||
} else if (verbose)
|
||||
out << "fileIndex " << tok->fileIndex() << " line " << tok->linenr() << std::endl << tok->astStringVerbose() << std::endl;
|
||||
out << "[" << fileNames[tok->fileIndex()] << ":" << tok->linenr() << "]" << std::endl << tok->astStringVerbose() << std::endl;
|
||||
else
|
||||
out << tok->astString(" ") << std::endl;
|
||||
if (tok->str() == "(")
|
||||
|
|
|
@ -1340,7 +1340,7 @@ public:
|
|||
|
||||
std::string expressionString() const;
|
||||
|
||||
void printAst(bool verbose, bool xml, std::ostream &out) const;
|
||||
void printAst(bool verbose, bool xml, const std::vector<std::string> &fileNames, std::ostream &out) const;
|
||||
|
||||
void printValueFlow(bool xml, std::ostream &out) const;
|
||||
|
||||
|
|
|
@ -4903,7 +4903,7 @@ void Tokenizer::printDebugOutput(int simplification) const
|
|||
}
|
||||
|
||||
if (mSettings->verbose)
|
||||
list.front()->printAst(mSettings->verbose, mSettings->xml, std::cout);
|
||||
list.front()->printAst(mSettings->verbose, mSettings->xml, list.getFiles(), std::cout);
|
||||
|
||||
list.front()->printValueFlow(mSettings->xml, std::cout);
|
||||
|
||||
|
|
Loading…
Reference in New Issue