xgo/ast/binary_expr.go
2019-01-11 01:16:34 -08:00

27 lines
471 B
Go

package ast
import (
"github.com/d5/tengo/source"
"github.com/d5/tengo/token"
)
type BinaryExpr struct {
Lhs Expr
Rhs Expr
Token token.Token
TokenPos source.Pos
}
func (e *BinaryExpr) exprNode() {}
func (e *BinaryExpr) Pos() source.Pos {
return e.Lhs.Pos()
}
func (e *BinaryExpr) End() source.Pos {
return e.Rhs.End()
}
func (e *BinaryExpr) String() string {
return "(" + e.Lhs.String() + " " + e.Token.String() + " " + e.Rhs.String() + ")"
}