Parse Struct Declarations

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-03-27 03:33:15 -04:00
parent 5abaac2816
commit cd26d1d22c
14 changed files with 426 additions and 155 deletions
+2 -2
View File
@@ -230,7 +230,7 @@ extension VariableDeclarationStatement: CompilableStatement {
identifier: parsed_variablename, withInitializer: initializer),
// Context with updated names to include the newly declared name.
context.update(
newNames: context.names.declare(
newInstances: context.instances.declare(
identifier: parsed_variablename, withValue: declaration_p4_type))
))
}
@@ -282,7 +282,7 @@ extension ParserAssignmentStatement: CompilableStatement {
return Result.Error(maybe_parsed_lvalue.error()!)
}
let check_result = lvalue_identifier.check(to: rvalue, inScopes: context.names)
let check_result = lvalue_identifier.check(to: rvalue, inScopes: context.instances)
guard case .Ok(_) = check_result else {
return Result.Error(
ErrorOnNode(