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:
@@ -44,7 +44,7 @@ extension ConditionalStatement: EvaluatableStatement {
|
||||
guard case .Ok(let evaluated_condition) = self.condition.evaluate(execution: execution) else {
|
||||
return execution.setError(error: Error(withMessage: "Could not evaluate \(self.condition)"))
|
||||
}
|
||||
if !evaluated_condition.type().eq(rhs: P4Boolean.create()) {
|
||||
if !evaluated_condition.type().eq(rhs: P4Boolean()) {
|
||||
return execution.setError(error: Error(withMessage: "Condition expression is not a Boolean"))
|
||||
}
|
||||
if evaluated_condition.eq(rhs: P4BooleanValue.init(withValue: true)) {
|
||||
|
||||
Reference in New Issue
Block a user