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

26 lines
437 B
Go

package ast
import (
"github.com/d5/tengo/source"
"github.com/d5/tengo/token"
)
type IncDecStmt struct {
Expr Expr
Token token.Token
TokenPos source.Pos
}
func (s *IncDecStmt) stmtNode() {}
func (s *IncDecStmt) Pos() source.Pos {
return s.Expr.Pos()
}
func (s *IncDecStmt) End() source.Pos {
return source.Pos(int(s.TokenPos) + 2)
}
func (s *IncDecStmt) String() string {
return s.Expr.String() + s.Token.String()
}