Support Setting Arrays/Fields

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-03-20 02:32:15 -04:00
parent d7696e822c
commit 04627f20e2
9 changed files with 326 additions and 74 deletions
+6 -2
View File
@@ -24,9 +24,13 @@ extension ParserAssignmentStatement: EvaluatableStatement {
guard case Result.Ok(let value) = result else {
return execution.setError(error: result.error()!)
}
let updated_scopes = execution.scopes.set(identifier: self.lvalue, withValue: value)
execution.scopes = updated_scopes
let maybe_updated_scopes = self.lvalue.set(
to: value, inScopes: execution.scopes, duringExecution: execution)
guard case Result.Ok(let updated_scopes) = maybe_updated_scopes else {
return execution.setError(error: maybe_updated_scopes.error()!)
}
execution.scopes = updated_scopes.0
return execution
}