Documentation ¶
Index ¶
- Variables
- func InSlice(slice []string, value string) bool
- func LineNumber(source string, pos int) int
- func NewParser(input string) *parser
- func ObjToString(val interface{}) string
- type BoolToken
- type CommentToken
- type ContextStack
- func (this *ContextStack) AddLayer()
- func (this *ContextStack) DropLayer()
- func (this *ContextStack) Get(name string) reflect.Value
- func (this *ContextStack) GetOk(name string) (value reflect.Value, ok bool)
- func (this *ContextStack) Set(name string, value interface{})
- func (this *ContextStack) SetGlobal(name string, value reflect.Value)
- type EmptyToken
- type ErrorToken
- type EvalJade
- func (this *EvalJade) Exec(parsedJade *TreeNode)
- func (this *EvalJade) RegisterFunction(name string, fn interface{})
- func (this *EvalJade) RenderFile(filename string)
- func (this *EvalJade) RenderString(template string)
- func (this *EvalJade) SetData(data interface{})
- func (this *EvalJade) SetViewPath(viewpath string)
- type FuncToken
- type Getter
- type GroupToken
- type HtmlDocTypeToken
- type HtmlTagToken
- type KeyValueToken
- type LRFuncToken
- type LinearMap
- type NumberToken
- type OperatorPrecedence
- type OperatorToken
- type ParseResult
- type Template
- type TemplateLoader
- type TextToken
- type Token
- type TokenCategory
- type TreeNode
- func (this *TreeNode) AddElement(element *TreeNode) *TreeNode
- func (this *TreeNode) Depth() int
- func (this *TreeNode) Items() []*TreeNode
- func (this *TreeNode) Last() Token
- func (this *TreeNode) LastElement() *TreeNode
- func (this *TreeNode) Parent() *TreeNode
- func (this *TreeNode) PushElement(element *TreeNode) *TreeNode
- func (this *TreeNode) ReplaceNode(node *TreeNode) *TreeNode
- func (this *TreeNode) Root() *TreeNode
- func (this *TreeNode) String() string
- func (this *TreeNode) StringContent() string
- type VariableNotDefined
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyString = reflect.ValueOf("")
Functions ¶
func LineNumber ¶
func ObjToString ¶
func ObjToString(val interface{}) string
Types ¶
type CommentToken ¶
type CommentToken struct { EmptyToken CommentType string }
func NewCommentToken ¶
func NewCommentToken(commentType string) *CommentToken
func (*CommentToken) String ¶
func (this *CommentToken) String() string
type ContextStack ¶
type ContextStack struct {
// contains filtered or unexported fields
}
ContextStack is a stack of maps, used to track functions with context like for loops, mixins, etc
type EmptyToken ¶
type EmptyToken struct {
// contains filtered or unexported fields
}
func NewEmptyToken ¶
func NewEmptyToken() *EmptyToken
func (*EmptyToken) Category ¶
func (this *EmptyToken) Category() TokenCategory
func (*EmptyToken) Error ¶
func (this *EmptyToken) Error() error
func (*EmptyToken) SetError ¶
func (this *EmptyToken) SetError(err error)
func (*EmptyToken) String ¶
func (this *EmptyToken) String() string
type ErrorToken ¶
type ErrorToken struct {
EmptyToken
}
func NewErrorToken ¶
func NewErrorToken(err string) *ErrorToken
type EvalJade ¶
type EvalJade struct { Loader TemplateLoader Extfunc map[string]reflect.Value Blocks map[string]*jadePart Mixins map[string]*jadePart Beautify bool Log []string // contains filtered or unexported fields }
func NewEvalJade ¶
func (*EvalJade) RegisterFunction ¶
func (*EvalJade) RenderFile ¶
func (*EvalJade) RenderString ¶
func (*EvalJade) SetViewPath ¶
type FuncToken ¶
type FuncToken struct { EmptyToken Name string Arguments []*TreeNode Next *FuncToken IsIdentity bool Index *TreeNode }
func NewFuncToken ¶
func NewIdentityToken ¶
func (*FuncToken) AddArgument ¶
type GroupToken ¶
type GroupToken struct { EmptyToken GroupType string }
func NewGroupToken ¶
func NewGroupToken(group string) *GroupToken
func (*GroupToken) String ¶
func (this *GroupToken) String() string
type HtmlDocTypeToken ¶
type HtmlDocTypeToken struct { EmptyToken Attributes []string }
func NewHtmlDocTypeToken ¶
func NewHtmlDocTypeToken() *HtmlDocTypeToken
func (*HtmlDocTypeToken) String ¶
func (this *HtmlDocTypeToken) String() string
type HtmlTagToken ¶
type HtmlTagToken struct { EmptyToken TagName string Attributes []*TreeNode SelfClosing bool }
func NewHtmlTagToken ¶
func NewHtmlTagToken(tagname string) *HtmlTagToken
func (*HtmlTagToken) AddAttribute ¶
func (this *HtmlTagToken) AddAttribute(attr *TreeNode) *TreeNode
func (*HtmlTagToken) AddKeyValue ¶
func (this *HtmlTagToken) AddKeyValue(key string, value *TreeNode) *TreeNode
func (*HtmlTagToken) SetClass ¶
func (this *HtmlTagToken) SetClass(attr *TreeNode) *TreeNode
func (*HtmlTagToken) String ¶
func (this *HtmlTagToken) String() string
type KeyValueToken ¶
type KeyValueToken struct { EmptyToken Key string Value *TreeNode }
func NewKeyValueToken ¶
func NewKeyValueToken(key string, value *TreeNode) *KeyValueToken
func (*KeyValueToken) String ¶
func (this *KeyValueToken) String() string
type LRFuncToken ¶
type LRFuncToken struct { EmptyToken Name string }
func NewLRFuncToken ¶
func NewLRFuncToken(name string) *LRFuncToken
func (*LRFuncToken) String ¶
func (this *LRFuncToken) String() string
type LinearMap ¶
type LinearMap struct {
// contains filtered or unexported fields
}
LinearMap insure the map is iterated in the same order as the key values was added to the map.
type NumberToken ¶
type NumberToken struct { EmptyToken Value float64 }
func NewNumberToken ¶
func NewNumberToken(value string) *NumberToken
func (*NumberToken) String ¶
func (this *NumberToken) String() string
type OperatorPrecedence ¶
type OperatorPrecedence [][]string
func (OperatorPrecedence) All ¶
func (this OperatorPrecedence) All() []string
func (OperatorPrecedence) Level ¶
func (this OperatorPrecedence) Level(operator string) int
type OperatorToken ¶
type OperatorToken struct { EmptyToken Operator string // contains filtered or unexported fields }
func NewOperatorToken ¶
func NewOperatorToken(operator string) *OperatorToken
func (*OperatorToken) Precedence ¶
func (this *OperatorToken) Precedence(operator string) int
OperatorPrecedence return true if the operator argument is lower than the current operator.
func (*OperatorToken) SetOperator ¶
func (this *OperatorToken) SetOperator(operator string)
func (*OperatorToken) String ¶
func (this *OperatorToken) String() string
type ParseResult ¶
type ParseResult struct { Root *TreeNode Err error Log []string Mixins map[string]*TreeNode Blocks map[string]*TreeNode Extends string }
func Parse ¶
func Parse(input string) *ParseResult
type TemplateLoader ¶
type Token ¶
type Token interface { Category() TokenCategory SetError(err error) Error() error String() string }
type TokenCategory ¶
type TokenCategory int
const ( CatOther TokenCategory = iota CatFunction CatValue )
type TreeNode ¶
func NewTreeNode ¶
NewTreeElement Creates a new TreeElement.
func ParseExpression ¶
func (*TreeNode) AddElement ¶
Add adds a TreeElement to the end of the children items of the current node.
func (*TreeNode) LastElement ¶
func (*TreeNode) PushElement ¶
Push, removes the current element from its current parent, place the new value in its place and add the current element to the new element. there by pushing the current element down the hierachy. Example: tree: A(B) B.Push(C) tree: A(C(B))
func (*TreeNode) ReplaceNode ¶
func (*TreeNode) StringContent ¶
type VariableNotDefined ¶
type VariableNotDefined struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.