xgo/ast/map_element_lit.go

25 lines
409 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 MapElementLit struct {
Key string
KeyPos source.Pos
ColonPos source.Pos
2019-01-09 10:17:42 +03:00
Value Expr
}
func (e *MapElementLit) exprNode() {}
func (e *MapElementLit) Pos() source.Pos {
2019-01-09 10:17:42 +03:00
return e.KeyPos
}
func (e *MapElementLit) End() source.Pos {
2019-01-09 10:17:42 +03:00
return e.Value.End()
}
func (e *MapElementLit) String() string {
return e.Key + ": " + e.Value.String()
}