Fix issue where heap was not marked

This commit is contained in:
nub31
2025-02-02 22:35:31 +01:00
parent 1db0aefc55
commit d318c99792
3 changed files with 42 additions and 35 deletions

View File

@@ -41,10 +41,10 @@ public class Generator
public string Generate()
{
_builder.AppendLine("global _start");
_builder.AppendLine("extern gc_init");
_builder.AppendLine("extern gc_alloc");
_builder.AppendLine("extern str_cmp");
foreach (var externFuncDefinition in _definitions.OfType<ExternFuncDefinitionNode>())
{
_builder.AppendLine($"extern {externFuncDefinition.Name}");
@@ -143,7 +143,7 @@ public class Generator
}
default:
{
throw new InvalidOperationException("Global variables must have the ability yo be evaluated at compile time");
throw new InvalidOperationException("Global variables must be compile time consistant");
}
}
}

View File

@@ -377,10 +377,8 @@ public class Parser
case Symbol.New:
{
var type = ParseType();
switch (type)
{
// TODO: Parse arrays differently
case ArrayType:
{
ExpectSymbol(Symbol.OpenParen);