Relative paths in import directives.

This commit is contained in:
chriseth
2015-12-09 19:21:02 +01:00
parent 7cb7818cea
commit f8228e8ab1
7 changed files with 67 additions and 9 deletions
+7
View File
@@ -56,6 +56,13 @@ Error ASTNode::createTypeError(string const& _description) const
return Error(Error::Type::TypeError) << errinfo_sourceLocation(location()) << errinfo_comment(_description);
}
ImportAnnotation& ImportDirective::annotation() const
{
if (!m_annotation)
m_annotation = new ImportAnnotation();
return static_cast<ImportAnnotation&>(*m_annotation);
}
map<FixedHash<4>, FunctionTypePointer> ContractDefinition::interfaceFunctions() const
{
auto exportedFunctionList = interfaceFunctionList();
+1
View File
@@ -142,6 +142,7 @@ public:
virtual void accept(ASTConstVisitor& _visitor) const override;
ASTString const& identifier() const { return *m_identifier; }
virtual ImportAnnotation& annotation() const override;
private:
ASTPointer<ASTString> m_identifier;
+6
View File
@@ -54,6 +54,12 @@ struct DocumentedAnnotation
std::multimap<std::string, DocTag> docTags;
};
struct ImportAnnotation: ASTAnnotation
{
/// The absolute path of the source unit to import.
std::string absolutePath;
};
struct TypeDeclarationAnnotation: ASTAnnotation
{
/// The name of this type, prefixed by proper namespaces if globally accessible.