2019-01-09 10:17:42 +03:00
|
|
|
package ast
|
|
|
|
|
2019-01-11 12:16:34 +03:00
|
|
|
import "github.com/d5/tengo/source"
|
2019-01-09 10:17:42 +03:00
|
|
|
|
|
|
|
type Ident struct {
|
|
|
|
Name string
|
2019-01-11 12:16:34 +03:00
|
|
|
NamePos source.Pos
|
2019-01-09 10:17:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e *Ident) exprNode() {}
|
|
|
|
|
2019-01-11 12:16:34 +03:00
|
|
|
func (e *Ident) Pos() source.Pos {
|
2019-01-09 10:17:42 +03:00
|
|
|
return e.NamePos
|
|
|
|
}
|
|
|
|
|
2019-01-11 12:16:34 +03:00
|
|
|
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
|
|
|
|
}
|