2019-01-09 10:17:42 +03:00
|
|
|
package ast
|
|
|
|
|
|
|
|
import (
|
2019-01-11 12:16:34 +03:00
|
|
|
"github.com/d5/tengo/source"
|
2019-01-09 10:17:42 +03:00
|
|
|
"github.com/d5/tengo/token"
|
|
|
|
)
|
|
|
|
|
|
|
|
type IncDecStmt struct {
|
|
|
|
Expr Expr
|
|
|
|
Token token.Token
|
2019-01-11 12:16:34 +03:00
|
|
|
TokenPos source.Pos
|
2019-01-09 10:17:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *IncDecStmt) stmtNode() {}
|
|
|
|
|
2019-01-11 12:16:34 +03:00
|
|
|
func (s *IncDecStmt) Pos() source.Pos {
|
2019-01-09 10:17:42 +03:00
|
|
|
return s.Expr.Pos()
|
|
|
|
}
|
|
|
|
|
2019-01-11 12:16:34 +03:00
|
|
|
func (s *IncDecStmt) End() source.Pos {
|
|
|
|
return source.Pos(int(s.TokenPos) + 2)
|
2019-01-09 10:17:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s *IncDecStmt) String() string {
|
|
|
|
return s.Expr.String() + s.Token.String()
|
|
|
|
}
|