...
This commit is contained in:
@@ -48,4 +48,13 @@ public sealed class Module
|
||||
.Where(x => x.Exported || includePrivate)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public List<string> Imports()
|
||||
{
|
||||
return _definitions
|
||||
.OfType<ImportSyntax>()
|
||||
.Select(x => x.NameToken.Value)
|
||||
.Distinct()
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
@@ -36,15 +36,17 @@ public sealed class TypedModule
|
||||
structTypes.Add(new NubStructType(name, structSyntax.NameToken.Value, fields));
|
||||
}
|
||||
|
||||
return new TypedModule(functionPrototypes, structTypes);
|
||||
return new TypedModule(functionPrototypes, structTypes, module.Imports());
|
||||
}
|
||||
|
||||
public TypedModule(List<FuncPrototypeNode> functionPrototypes, List<NubStructType> structTypes)
|
||||
public TypedModule(List<FuncPrototypeNode> functionPrototypes, List<NubStructType> structTypes, List<string> imports)
|
||||
{
|
||||
FunctionPrototypes = functionPrototypes;
|
||||
StructTypes = structTypes;
|
||||
Imports = imports;
|
||||
}
|
||||
|
||||
public List<FuncPrototypeNode> FunctionPrototypes { get; set; }
|
||||
public List<NubStructType> StructTypes { get; set; }
|
||||
public List<FuncPrototypeNode> FunctionPrototypes { get; }
|
||||
public List<NubStructType> StructTypes { get; }
|
||||
public List<string> Imports { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user