module exports and name mangling
This commit is contained in:
@@ -291,7 +291,9 @@ public sealed class TypeChecker(string fileName, string moduleName, NodeDefiniti
|
||||
if (!moduleGraph.TryResolveModule(expression.Module.Ident, out var module))
|
||||
throw new CompileException(Diagnostic.Error($"Module '{expression.Module.Ident}' not found").At(fileName, expression.Module).Build());
|
||||
|
||||
if (!module.TryResolveIdentifierType(expression.Value.Ident, out var identifierType))
|
||||
var includePrivate = expression.Module.Ident == moduleName;
|
||||
|
||||
if (!module.TryResolveIdentifierType(expression.Value.Ident, includePrivate, out var identifierType))
|
||||
throw new CompileException(Diagnostic.Error($"Identifier '{expression.Module.Ident}::{expression.Value.Ident}' not found").At(fileName, expression.Value).Build());
|
||||
|
||||
return new TypedNodeExpressionModuleIdent(expression.Tokens, identifierType, expression.Module, expression.Value);
|
||||
@@ -336,7 +338,9 @@ public sealed class TypeChecker(string fileName, string moduleName, NodeDefiniti
|
||||
if (!moduleGraph.TryResolveModule(expression.Module.Ident, out var module))
|
||||
throw new CompileException(Diagnostic.Error($"Module '{expression.Module.Ident}' not found").At(fileName, expression.Module).Build());
|
||||
|
||||
if (!module.TryResolveCustomType(expression.Name.Ident, out var customType))
|
||||
var includePrivate = expression.Module.Ident == moduleName;
|
||||
|
||||
if (!module.TryResolveCustomType(expression.Name.Ident, includePrivate, out var customType))
|
||||
throw new CompileException(Diagnostic.Error($"Struct '{expression.Module.Ident}::{expression.Name.Ident}' not found").At(fileName, expression.Name).Build());
|
||||
|
||||
if (customType is not NubTypeStruct structType)
|
||||
@@ -380,7 +384,9 @@ public sealed class TypeChecker(string fileName, string moduleName, NodeDefiniti
|
||||
if (!moduleGraph.TryResolveModule(type.Module.Ident, out var module))
|
||||
throw new CompileException(Diagnostic.Error($"Module '{type.Module.Ident}' not found").At(fileName, type.Module).Build());
|
||||
|
||||
if (!module.TryResolveCustomType(type.Name.Ident, out var customType))
|
||||
var includePrivate = type.Module.Ident == moduleName;
|
||||
|
||||
if (!module.TryResolveCustomType(type.Name.Ident, includePrivate, out var customType))
|
||||
throw new CompileException(Diagnostic.Error($"Custom type '{type.Module.Ident}::{type.Name.Ident}' not found").At(fileName, type.Name).Build());
|
||||
|
||||
return customType;
|
||||
|
||||
Reference in New Issue
Block a user