예제 #1
0
파일: ASTUtils.cpp 프로젝트: 1600/solidity
bool LocationFinder::visitNode(const ASTNode& _node)
{
	if (_node.getLocation().contains(m_location))
	{
		m_bestMatch = &_node;
		return true;
	}
	return false;
}
예제 #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;
	}
}