xgo/objects/continue.go

39 lines
877 B
Go
Raw Normal View History

2019-01-09 10:17:42 +03:00
package objects
2019-01-11 13:27:28 +03:00
import "github.com/d5/tengo/compiler/token"
2019-01-09 10:17:42 +03:00
// Continue represents a continue statement.
2019-01-09 10:17:42 +03:00
type Continue struct {
}
// TypeName returns the name of the type.
2019-01-09 10:17:42 +03:00
func (o *Continue) TypeName() string {
return "continue"
}
func (o *Continue) String() string {
return "<continue>"
}
// BinaryOp returns another object that is the result of
// a given binary operator and a right-hand side object.
2019-01-09 10:17:42 +03:00
func (o *Continue) BinaryOp(op token.Token, rhs Object) (Object, error) {
return nil, ErrInvalidOperator
}
// Copy returns a copy of the type.
2019-01-09 10:17:42 +03:00
func (o *Continue) Copy() Object {
return &Continue{}
}
// IsFalsy returns true if the value of the type is falsy.
2019-01-09 10:17:42 +03:00
func (o *Continue) IsFalsy() bool {
return false
}
// Equals returns true if the value of the type
// is equal to the value of another object.
2019-01-09 10:17:42 +03:00
func (o *Continue) Equals(x Object) bool {
return false
}