25 lines
493 B
C#
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);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|