2019-01-09 10:17:42 +03:00
|
|
|
package ast
|
|
|
|
|
2019-01-11 13:27:28 +03:00
|
|
|
import "github.com/d5/tengo/compiler/source"
|
2019-01-09 10:17:42 +03:00
|
|
|
|
2019-01-15 09:24:33 +03:00
|
|
|
// ExprStmt represents an expression statement.
|
2019-01-09 10:17:42 +03:00
|
|
|
type ExprStmt struct {
|
|
|
|
Expr Expr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *ExprStmt) stmtNode() {}
|
|
|
|
|
2019-01-15 09:24:33 +03:00
|
|
|
// Pos returns the position of first character belonging to the node.
|
2019-01-11 12:16:34 +03:00
|
|
|
func (s *ExprStmt) Pos() source.Pos {
|
2019-01-09 10:17:42 +03:00
|
|
|
return s.Expr.Pos()
|
|
|
|
}
|
|
|
|
|
2019-01-15 09:24:33 +03:00
|
|
|
// End returns the position of first character immediately after the node.
|
2019-01-11 12:16:34 +03:00
|
|
|
func (s *ExprStmt) End() source.Pos {
|
2019-01-09 10:17:42 +03:00
|
|
|
return s.Expr.End()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s *ExprStmt) String() string {
|
|
|
|
return s.Expr.String()
|
|
|
|
}
|