rum-goggles/v1/vendor/github.com/robertkrimen/otto/result.go

29 lines
463 B
Go
Raw Normal View History

package otto
2024-04-04 14:46:14 +00:00
type resultKind int
const (
2024-04-04 14:46:14 +00:00
_ resultKind = iota
resultReturn
resultBreak
resultContinue
)
2024-04-04 14:46:14 +00:00
type result struct {
kind resultKind
value Value
target string
}
2024-04-04 14:46:14 +00:00
func newReturnResult(value Value) result {
return result{resultReturn, value, ""}
}
2024-04-04 14:46:14 +00:00
func newContinueResult(target string) result {
return result{resultContinue, emptyValue, target}
}
2024-04-04 14:46:14 +00:00
func newBreakResult(target string) result {
return result{resultBreak, emptyValue, target}
}