5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-15 21:20:29 +00:00
matterbridge/vendor/github.com/d5/tengo/compiler/ast/func_lit.go

26 lines
561 B
Go
Raw Normal View History

package ast
import "github.com/d5/tengo/compiler/source"
// FuncLit represents a function literal.
type FuncLit struct {
Type *FuncType
Body *BlockStmt
}
func (e *FuncLit) exprNode() {}
// Pos returns the position of first character belonging to the node.
func (e *FuncLit) Pos() source.Pos {
return e.Type.Pos()
}
// End returns the position of first character immediately after the node.
func (e *FuncLit) End() source.Pos {
return e.Body.End()
}
func (e *FuncLit) String() string {
return "func" + e.Type.Params.String() + " " + e.Body.String()
}