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 FuncLit struct {
|
|
|
|
Type *FuncType
|
|
|
|
Body *BlockStmt
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *FuncLit) exprNode() {}
|
|
|
|
|
2019-01-11 12:16:34 +03:00
|
|
|
func (e *FuncLit) Pos() source.Pos {
|
2019-01-09 10:17:42 +03:00
|
|
|
return e.Type.Pos()
|
|
|
|
}
|
|
|
|
|
2019-01-11 12:16:34 +03:00
|
|
|
func (e *FuncLit) End() source.Pos {
|
2019-01-09 10:17:42 +03:00
|
|
|
return e.Body.End()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *FuncLit) String() string {
|
|
|
|
return "func" + e.Type.Params.String() + " " + e.Body.String()
|
|
|
|
}
|