Refactor Parsers and Parser States

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-03-10 03:56:18 -04:00
parent 7c7416fa64
commit 3188b52965
12 changed files with 223 additions and 381 deletions
+3 -2
View File
@@ -62,12 +62,13 @@ public struct Program {
node: parser_declaration.nodes[1], inTree: tree, withLexicalScopes: program_scope)
{
case Result.Ok((let parser, let new_program_scope)):
program.types.append(parser)
program_scope = new_program_scope
program_scope = new_program_scope.declare(identifier: parser.name, withValue: parser)
case Result.Error(let error): return Result.Error(error)
}
}
// Any of the types that are in the top-level scope should go into the program!
program.types = Array(program_scope)
return Result.Ok(program)
}
}