small fixes

This commit is contained in:
nub31
2025-06-11 10:46:41 +02:00
parent 459f264679
commit e5d3e3b0cf
5 changed files with 20 additions and 12 deletions

View File

@@ -72,7 +72,7 @@ public class SymbolTable
public Func LookupFunc(string @namespace, string name)
{
return _functions.Single(x => x.Name == name);
return _functions.Single(x => x.Name == name && x.Namespace == @namespace);
}
public Variable LookupVariable(string name)
@@ -100,4 +100,10 @@ public class SymbolTable
public string Namespace { get; } = @namespace;
public string GeneratedName { get; } = generatedName;
}
public class Struct(string @namespace, string name) : Symbol(name)
{
public string Namespace { get; } = @namespace;
public string GeneratedName => $"{Namespace}_{Name}";
}
}