Exec implements the InterpretableV2 interface method.
(frame *ExecutionFrame)
| 355 | |
| 356 | // Exec implements the InterpretableV2 interface method. |
| 357 | func (or *evalOr) Exec(frame *ExecutionFrame) ref.Val { |
| 358 | var err ref.Val = nil |
| 359 | var unk *types.Unknown |
| 360 | for _, term := range or.terms { |
| 361 | val := term.Exec(frame) |
| 362 | boolVal, ok := val.(types.Bool) |
| 363 | // short-circuit on true. |
| 364 | if ok && boolVal == types.True { |
| 365 | return types.True |
| 366 | } |
| 367 | if !ok { |
| 368 | if unkVal, isUnk := val.(*types.Unknown); isUnk { |
| 369 | if unk == nil { |
| 370 | unk = unkVal |
| 371 | } else { |
| 372 | unk = types.MergeUnknowns(unk, unkVal) |
| 373 | } |
| 374 | } else if err == nil { |
| 375 | if isError(val) { |
| 376 | err = val |
| 377 | } else { |
| 378 | err = types.MaybeNoSuchOverloadErr(val) |
| 379 | } |
| 380 | err = types.LabelErrNode(or.id, err) |
| 381 | } |
| 382 | } |
| 383 | } |
| 384 | if unk != nil { |
| 385 | return unk |
| 386 | } |
| 387 | if err != nil { |
| 388 | return err |
| 389 | } |
| 390 | return types.False |
| 391 | } |
| 392 | |
| 393 | // Eval implements the Interpretable interface method. |
| 394 | func (or *evalOr) Eval(ctx Activation) ref.Val { |
nothing calls this directly
no test coverage detected