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

26 lines
425 B
Go

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