xgo/ast/ident.go

27 lines
370 B
Go
Raw Normal View History

2019-01-09 10:17:42 +03:00
package ast
import "github.com/d5/tengo/source"
2019-01-09 10:17:42 +03:00
type Ident struct {
Name string
NamePos source.Pos
2019-01-09 10:17:42 +03:00
}
func (e *Ident) exprNode() {}
func (e *Ident) Pos() source.Pos {
2019-01-09 10:17:42 +03:00
return e.NamePos
}
func (e *Ident) End() source.Pos {
return source.Pos(int(e.NamePos) + len(e.Name))
2019-01-09 10:17:42 +03:00
}
func (e *Ident) String() string {
if e != nil {
return e.Name
}
return nullRep
}