bool ReferencesResolver::visit(Identifier const& _identifier)
{
    auto declarations = m_resolver.nameFromCurrentScope(_identifier.name());
    if (declarations.empty())
        fatalDeclarationError(_identifier.location(), "Undeclared identifier.");
    else if (declarations.size() == 1)
        _identifier.annotation().referencedDeclaration = declarations.front();
    else
        _identifier.annotation().overloadedDeclarations =
            m_resolver.cleanedDeclarations(_identifier, declarations);
    return false;
}
Example #2
0
std::string tesla::ShortName(const Identifier& ID) {
  if (ID.has_name())
    return ID.name();

  return ShortName(ID.location());
}