meowlang/typechecker/TypeRegistry.cs
Gwendolyn d6bdd08002 loooots of stuff
the typechecker project can collect all the top level types from a file, which is pretty cool I think
(except for pointers, those aren't implemented yet...)
2022-02-13 02:41:16 +01:00

25 lines
493 B
C#

namespace meowlang.typechecker;
public class TypeRegistry
{
private readonly Dictionary<Guid, TypeDescription> _types = new ();
public Dictionary<Guid, TypeDescription> DebugGetTypes => _types;
public void Add(Guid guid, TypeDescription description)
{
_types[guid] = description;
}
public TypeDescription Get(Guid guid)
{
return _types[guid];
}
public bool Has(Guid guid)
{
return _types.ContainsKey(guid);
}
}