Work On Derived Types

1. Add support for field access
2. Add support for proper type checking of array access
3. Add tests for nested field and array access

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-03-16 08:31:16 -04:00
parent 8ee20fcf9f
commit 2fd5ecf8d6
10 changed files with 629 additions and 72 deletions
+4 -6
View File
@@ -199,14 +199,12 @@ extension VariableDeclarationStatement: CompilableStatement {
Error(withMessage: "Could not parse variable name"))
}
let maybe_parsed_rvalue = Expression.Compile(node: rvalue, withContext: context)
guard
case .Ok(let parsed_rvalue) = Expression.Compile(
node: rvalue, withContext: context)
case .Ok(let parsed_rvalue) = maybe_parsed_rvalue
else {
return Result.Error(
Error(
withMessage:
"Could not parse initial value expression in a variable declaration statement"))
return .Error(maybe_parsed_rvalue.error()!)
}
guard case .Ok(let declaration_p4_type) = Types.CompileBasicType(type: typeref.text!) else {