xgo/compiler/ast/bad_expr.go

26 lines
509 B
Go
Raw Normal View History

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
// BadExpr represents a bad expression.
2019-01-09 10:17:42 +03:00
type BadExpr struct {
From source.Pos
To source.Pos
2019-01-09 10:17:42 +03:00
}
func (e *BadExpr) exprNode() {}
// Pos returns the position of first character belonging to the node.
func (e *BadExpr) Pos() source.Pos {
2019-01-09 10:17:42 +03:00
return e.From
}
// End returns the position of first character immediately after the node.
func (e *BadExpr) End() source.Pos {
2019-01-09 10:17:42 +03:00
return e.To
}
func (e *BadExpr) String() string {
return "<bad expression>"
}