Documentation ¶
Index ¶
- type ArrayLiteral
- type AssignStmt
- type BlockStmt
- type BooleanLiteral
- type BreakStmt
- type CallExp
- type ContinueStmt
- type DotExp
- type EachStmt
- type ElseIfStmt
- type Expression
- type ExpressionStmt
- type FloatLiteral
- type ForStmt
- type HTMLStmt
- type Identifier
- type IfStmt
- type IndexExp
- type InfixExp
- type InsertStmt
- type IntegerLiteral
- type NilLiteral
- type Node
- type ObjectLiteral
- type PostfixExp
- type PrefixExp
- type Program
- func (p *Program) ApplyInserts(inserts map[string]*InsertStmt, absPath string) *fail.Error
- func (p *Program) ApplyLayout(layoutProg *Program) error
- func (p *Program) HasReserveStmt() bool
- func (p *Program) HasUseStmt() (bool, *UseStmt)
- func (p *Program) Inserts() map[string]*InsertStmt
- func (p *Program) Line() uint
- func (p *Program) String() string
- func (p *Program) TokenLiteral() string
- type ReserveStmt
- type Statement
- type StringLiteral
- type TernaryExp
- type UseStmt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayLiteral ¶ added in v0.0.2
type ArrayLiteral struct { Token token.Token Elements []Expression }
func (*ArrayLiteral) Line ¶ added in v0.0.2
func (al *ArrayLiteral) Line() uint
func (*ArrayLiteral) String ¶ added in v0.0.2
func (al *ArrayLiteral) String() string
func (*ArrayLiteral) TokenLiteral ¶ added in v0.0.2
func (al *ArrayLiteral) TokenLiteral() string
type AssignStmt ¶ added in v1.1.0
type AssignStmt struct { Token token.Token // The 'var' or identifier token Name *Identifier Value Expression }
func (*AssignStmt) Line ¶ added in v1.1.0
func (as *AssignStmt) Line() uint
func (*AssignStmt) String ¶ added in v1.1.0
func (as *AssignStmt) String() string
func (*AssignStmt) TokenLiteral ¶ added in v1.1.0
func (as *AssignStmt) TokenLiteral() string
type BlockStmt ¶ added in v1.1.0
func (*BlockStmt) TokenLiteral ¶ added in v1.1.0
type BooleanLiteral ¶
func (*BooleanLiteral) Line ¶ added in v0.0.2
func (bl *BooleanLiteral) Line() uint
func (*BooleanLiteral) String ¶
func (bl *BooleanLiteral) String() string
func (*BooleanLiteral) TokenLiteral ¶
func (bl *BooleanLiteral) TokenLiteral() string
type BreakStmt ¶ added in v1.2.0
func (*BreakStmt) TokenLiteral ¶ added in v1.2.0
type CallExp ¶ added in v1.1.0
type CallExp struct { Token token.Token // Function identifier token Receiver Expression // Receiver of the call Function *Identifier // Function being called Arguments []Expression }
func (*CallExp) TokenLiteral ¶ added in v1.1.0
type ContinueStmt ¶ added in v1.2.0
func (*ContinueStmt) Line ¶ added in v1.2.0
func (cs *ContinueStmt) Line() uint
func (*ContinueStmt) String ¶ added in v1.2.0
func (cs *ContinueStmt) String() string
func (*ContinueStmt) TokenLiteral ¶ added in v1.2.0
func (cs *ContinueStmt) TokenLiteral() string
type DotExp ¶ added in v1.1.0
type DotExp struct { Token token.Token // The dot token Left Expression // -->x.y Key Expression // x.y<-- }
func (*DotExp) TokenLiteral ¶ added in v1.1.0
type EachStmt ¶ added in v1.1.0
type EachStmt struct { Token token.Token // The '@for' token Var *Identifier // The variable name Array Expression // The array to loop over Alternative *BlockStmt // The @else block Block *BlockStmt }
func (*EachStmt) TokenLiteral ¶ added in v1.1.0
type ElseIfStmt ¶ added in v1.1.0
type ElseIfStmt struct { Token token.Token Condition Expression Consequence *BlockStmt }
func (*ElseIfStmt) Line ¶ added in v1.1.0
func (eis *ElseIfStmt) Line() uint
func (*ElseIfStmt) String ¶ added in v1.1.0
func (eis *ElseIfStmt) String() string
func (*ElseIfStmt) TokenLiteral ¶ added in v1.1.0
func (eis *ElseIfStmt) TokenLiteral() string
type Expression ¶
type Expression interface { Node // contains filtered or unexported methods }
type ExpressionStmt ¶ added in v1.1.0
type ExpressionStmt struct { Token token.Token Expression Expression }
func (*ExpressionStmt) Line ¶ added in v1.1.0
func (es *ExpressionStmt) Line() uint
func (*ExpressionStmt) String ¶ added in v1.1.0
func (es *ExpressionStmt) String() string
func (*ExpressionStmt) TokenLiteral ¶ added in v1.1.0
func (es *ExpressionStmt) TokenLiteral() string
type FloatLiteral ¶ added in v0.0.2
func (*FloatLiteral) Line ¶ added in v0.0.2
func (fl *FloatLiteral) Line() uint
func (*FloatLiteral) String ¶ added in v0.0.2
func (fl *FloatLiteral) String() string
func (*FloatLiteral) TokenLiteral ¶ added in v0.0.2
func (fl *FloatLiteral) TokenLiteral() string
type ForStmt ¶ added in v1.1.0
type ForStmt struct { Token token.Token // The '@for' token Init Statement // The initialization statement; or nil Condition Expression // The condition expression; or nil Post Statement // The post iteration statement; or nil Alternative *BlockStmt // The @else block Block *BlockStmt }
func (*ForStmt) TokenLiteral ¶ added in v1.1.0
type HTMLStmt ¶ added in v1.1.0
func (*HTMLStmt) TokenLiteral ¶ added in v1.1.0
type Identifier ¶
func (*Identifier) Line ¶ added in v0.0.2
func (i *Identifier) Line() uint
func (*Identifier) String ¶
func (i *Identifier) String() string
func (*Identifier) TokenLiteral ¶
func (i *Identifier) TokenLiteral() string
type IfStmt ¶ added in v1.1.0
type IfStmt struct { Token token.Token // The '@if' token Condition Expression // The truthy condition Consequence *BlockStmt // The 'then' block Alternative *BlockStmt // The @else block Alternatives []*ElseIfStmt // The @elseif blocks }
func (*IfStmt) TokenLiteral ¶ added in v1.1.0
type IndexExp ¶ added in v1.1.0
type IndexExp struct { Token token.Token // The '[' token Left Expression Index Expression }
func (*IndexExp) TokenLiteral ¶ added in v1.1.0
type InfixExp ¶ added in v1.1.0
type InfixExp struct { Token token.Token // The operator token, e.g. + Operator string // The operator, e.g. + Left Expression Right Expression }
func (*InfixExp) TokenLiteral ¶ added in v1.1.0
type InsertStmt ¶ added in v1.1.0
type InsertStmt struct { Token token.Token // The '@insert' token Name *StringLiteral // The name of the insert statement Argument Expression // The argument to the insert statement; nil if has block Block *BlockStmt // The block of the insert statement; nil if has argument }
func (*InsertStmt) Line ¶ added in v1.1.0
func (is *InsertStmt) Line() uint
func (*InsertStmt) String ¶ added in v1.1.0
func (is *InsertStmt) String() string
func (*InsertStmt) TokenLiteral ¶ added in v1.1.0
func (is *InsertStmt) TokenLiteral() string
type IntegerLiteral ¶
func (*IntegerLiteral) Line ¶ added in v0.0.2
func (il *IntegerLiteral) Line() uint
func (*IntegerLiteral) String ¶
func (il *IntegerLiteral) String() string
func (*IntegerLiteral) TokenLiteral ¶
func (il *IntegerLiteral) TokenLiteral() string
type NilLiteral ¶
func (*NilLiteral) Line ¶ added in v0.0.2
func (nl *NilLiteral) Line() uint
func (*NilLiteral) String ¶
func (nl *NilLiteral) String() string
func (*NilLiteral) TokenLiteral ¶
func (nl *NilLiteral) TokenLiteral() string
type ObjectLiteral ¶ added in v0.0.8
type ObjectLiteral struct { Token token.Token // The '{' token Pairs map[string]Expression // The key-value pairs }
func (*ObjectLiteral) Line ¶ added in v0.0.8
func (os *ObjectLiteral) Line() uint
func (*ObjectLiteral) String ¶ added in v0.0.8
func (ol *ObjectLiteral) String() string
func (*ObjectLiteral) TokenLiteral ¶ added in v0.0.8
func (ol *ObjectLiteral) TokenLiteral() string
type PostfixExp ¶ added in v1.1.0
type PostfixExp struct { Token token.Token // The '++' or '--' token Operator string Left Expression }
func (*PostfixExp) Line ¶ added in v1.1.0
func (pe *PostfixExp) Line() uint
func (*PostfixExp) String ¶ added in v1.1.0
func (pe *PostfixExp) String() string
func (*PostfixExp) TokenLiteral ¶ added in v1.1.0
func (pe *PostfixExp) TokenLiteral() string
type PrefixExp ¶ added in v1.1.0
type PrefixExp struct { Token token.Token // The '!' or '-' token Operator string Right Expression }
func (*PrefixExp) TokenLiteral ¶ added in v1.1.0
type Program ¶
type Program struct { Token token.Token // The 'program' token Statements []Statement IsLayout bool }
func (*Program) ApplyInserts ¶ added in v0.0.2
func (*Program) ApplyLayout ¶ added in v0.0.2
Remove all the statements except the first one, which is the layout statement When we use layout, we do not print the file itself
func (*Program) HasReserveStmt ¶ added in v0.0.2
func (*Program) HasUseStmt ¶ added in v0.0.2
func (*Program) Inserts ¶ added in v0.0.2
func (p *Program) Inserts() map[string]*InsertStmt
func (*Program) TokenLiteral ¶
type ReserveStmt ¶ added in v1.1.0
type ReserveStmt struct { Token token.Token // The '@reserve' token Insert *InsertStmt // The insert statement; nil if not yet parsed Name *StringLiteral }
func (*ReserveStmt) Line ¶ added in v1.1.0
func (rs *ReserveStmt) Line() uint
func (*ReserveStmt) String ¶ added in v1.1.0
func (rs *ReserveStmt) String() string
func (*ReserveStmt) TokenLiteral ¶ added in v1.1.0
func (rs *ReserveStmt) TokenLiteral() string
type StringLiteral ¶
func (*StringLiteral) Line ¶ added in v0.0.2
func (sl *StringLiteral) Line() uint
func (*StringLiteral) String ¶
func (sl *StringLiteral) String() string
func (*StringLiteral) TokenLiteral ¶
func (sl *StringLiteral) TokenLiteral() string
type TernaryExp ¶ added in v1.1.0
type TernaryExp struct { Token token.Token // The '?' token Condition Expression Consequence Expression Alternative Expression }
func (*TernaryExp) Line ¶ added in v1.1.0
func (te *TernaryExp) Line() uint
func (*TernaryExp) String ¶ added in v1.1.0
func (te *TernaryExp) String() string
func (*TernaryExp) TokenLiteral ¶ added in v1.1.0
func (te *TernaryExp) TokenLiteral() string
type UseStmt ¶ added in v1.1.0
type UseStmt struct { Token token.Token // The '@use' token Name *StringLiteral // The relative path to the layout like 'layouts/main' Program *Program }
func (*UseStmt) TokenLiteral ¶ added in v1.1.0
Source Files ¶
- array_literal.go
- assign_stmt.go
- block_stmt.go
- boolean_literal.go
- break_stmt.go
- call_exp.go
- continue_stmt.go
- dot_exp.go
- each_stmt.go
- elseif_stmt.go
- expression.go
- expression_stmt.go
- float_literal.go
- for_stmt.go
- html_stmt.go
- identifier.go
- if_stmt.go
- index_exp.go
- infix_exp.go
- insert_stmt.go
- integer_literal.go
- nil_literal.go
- node.go
- object_literal.go
- postfix_exp.go
- prefix_exp.go
- program.go
- reserve_stmt.go
- statement.go
- string_literal.go
- ternary_exp.go
- use_stmt.go
Click to show internal directories.
Click to hide internal directories.