Documentation
¶
Overview ¶
Most of the code in this package taken from golang/text/template/parse
Index ¶
Constants ¶
View Source
const ( Quick Mode = iota // stop parsing after first error encoutered and return AllErrors // report all errors IncludeSensitive = "\\|" IncludeSeparator = "|" Include = "_INCLUDE_" Indent = "nindent" AbsSign = "#/---//---//Nocalhost//---//---/" ErrTmpl = `` /* 185-byte string literal not displayed */ )
Mode for parser behaviour
Variables ¶
View Source
var ( Relaxed = &Restrictions{false, false} NoEmpty = &Restrictions{false, true} NoUnset = &Restrictions{true, false} Strict = &Restrictions{true, true} )
Restrictions specifier
Functions ¶
This section is empty.
Types ¶
type Includation ¶
type Includation struct {
// contains filtered or unexported fields
}
type Parser ¶
type Parser struct {
Name string // name of the processing template
Env []Env
Restrict *Restrictions
Mode Mode
// contains filtered or unexported fields
}
Parser type initializer
func New ¶
func New(name string, envs [][]string, r *Restrictions) *Parser
New allocates a new Parser with the given name. envs means support multi source env[] the priority rely by the order
type Pos ¶
type Pos int
Pos represents a byte position in the original input text from which this template was parsed.
type Restrictions ¶
The restrictions option controls the parsring restriction.
type SubstitutionNode ¶
type SubstitutionNode struct {
NodeType
ExpType itemType
Variable *VariableNode
Default Node // Default could be variable or text
}
func (*SubstitutionNode) StringWithDefault ¶
func (t *SubstitutionNode) StringWithDefault() (k string, v string, err error)
type VariableNode ¶
type VariableNode struct {
NodeType
Ident string
Env []Env
Restrict *Restrictions
}
func NewVariable ¶
func NewVariable(ident string, env []Env, restrict *Restrictions) *VariableNode
Click to show internal directories.
Click to hide internal directories.