Example #1
0
bool LocationFinder::visitNode(const ASTNode& _node)
{
	if (_node.getLocation().contains(m_location))
	{
		m_bestMatch = &_node;
		return true;
	}
	return false;
}
Example #2
0
void ASTPrinter::printSourcePart(ASTNode const& _node)
{
	if (m_gasCosts.count(&_node))
		*m_ostream << getIndentation() << "   Gas costs: " << m_gasCosts.at(&_node) << endl;
	if (!m_source.empty())
	{
		SourceLocation const& location(_node.getLocation());
		*m_ostream << getIndentation() << "   Source: "
				   << escaped(m_source.substr(location.start, location.end - location.start), false) << endl;
	}
}