nodes

package
v0.0.0-...-a151dae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2022 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assign

type Assign struct {
	Target Expr
	Node   Node
	StmtCommon
}

func (*Assign) SetCtx

func (a *Assign) SetCtx(ctx string)

type AssignBlock

type AssignBlock struct {
	Target Expr
	Body   []Node
	Filter *Filter
	StmtCommon
}

func (*AssignBlock) SetCtx

func (a *AssignBlock) SetCtx(ctx string)

type BinExpr

type BinExpr struct {
	Left  Expr
	Right Expr
	Op    string // same as lexer.TokenAdd etc. + "and", "or"
	ExprCommon
}

func (*BinExpr) SetCtx

func (b *BinExpr) SetCtx(ctx string)

type Block

type Block struct {
	Name     string
	Body     []Node
	Scoped   bool
	Required bool
	StmtCommon
}

func (*Block) SetCtx

func (b *Block) SetCtx(ctx string)

type Call

type Call struct {
	Node      Expr
	Args      []Expr
	Kwargs    []Keyword
	DynArgs   *Expr
	DynKwargs *Expr
	ExprCommon
}

func (*Call) SetCtx

func (c *Call) SetCtx(ctx string)

type CallBlock

type CallBlock struct {
	Call Call
	Body []Node
	MacroCall
	StmtCommon
}

func (*CallBlock) SetCtx

func (c *CallBlock) SetCtx(ctx string)

type Compare

type Compare struct {
	Expr Expr
	Ops  []Operand
	ExprCommon
}

func (*Compare) SetCtx

func (c *Compare) SetCtx(ctx string)

type Concat

type Concat struct {
	Nodes []Expr
	ExprCommon
}

func (*Concat) SetCtx

func (c *Concat) SetCtx(ctx string)

type CondExpr

type CondExpr struct {
	Test  Expr
	Expr1 Expr
	Expr2 *Expr
	ExprCommon
}

func (*CondExpr) SetCtx

func (c *CondExpr) SetCtx(ctx string)

type Const

type Const struct {
	Value any
	LiteralCommon
}

func (*Const) SetCtx

func (c *Const) SetCtx(string)

type Dict

type Dict struct {
	Items []Pair
	LiteralCommon
}

func (*Dict) SetCtx

func (d *Dict) SetCtx(ctx string)

type EvalContextModifier

type EvalContextModifier struct {
	Options []Keyword
	StmtCommon
}

func (*EvalContextModifier) SetCtx

func (e *EvalContextModifier) SetCtx(ctx string)

type Expr

type Expr interface {
	CanAssign() bool
	Node
}

type ExprCommon

type ExprCommon NodeCommon

func (ExprCommon) CanAssign

func (ExprCommon) CanAssign() bool

func (*ExprCommon) GetLineno

func (e *ExprCommon) GetLineno() int

type ExprWithName

type ExprWithName interface {
	GetName() string
	Expr
}

type Extends

type Extends struct {
	Template Expr
	StmtCommon
}

func (*Extends) SetCtx

func (e *Extends) SetCtx(ctx string)

type Filter

type Filter struct {
	FilterTestCommon
}

type FilterBlock

type FilterBlock struct {
	Body   []Node
	Filter *Filter
	StmtCommon
}

func (*FilterBlock) SetCtx

func (f *FilterBlock) SetCtx(ctx string)

type FilterTestCommon

type FilterTestCommon struct {
	Node      *Expr
	Name      string
	Args      []Expr
	Kwargs    []Keyword // Jinja uses Pair but then other methods returns Keyword instead of Pair -_-
	DynArgs   *Expr
	DynKwargs *Expr
	ExprCommon
}

func (*FilterTestCommon) SetCtx

func (f *FilterTestCommon) SetCtx(ctx string)

type For

type For struct {
	Target    Node
	Iter      Node
	Body      []Node
	Else      []Node
	Test      *Node
	Recursive bool
	StmtCommon
}

func (*For) SetCtx

func (f *For) SetCtx(ctx string)

type FromImport

type FromImport struct {
	Template    Expr
	WithContext bool
	Names       [][]string // name or name with alias
	StmtCommon
}

func (*FromImport) SetCtx

func (f *FromImport) SetCtx(ctx string)

func (*FromImport) SetWithContext

func (f *FromImport) SetWithContext(b bool)

type Getattr

type Getattr struct {
	Node Expr
	Attr string
	Ctx  string
	ExprCommon
}

func (*Getattr) SetCtx

func (g *Getattr) SetCtx(ctx string)

type Getitem

type Getitem struct {
	Node Expr
	Arg  Expr
	Ctx  string
	ExprCommon
}

func (*Getitem) SetCtx

func (g *Getitem) SetCtx(ctx string)

type Helper

type Helper Node

type HelperCommon

type HelperCommon NodeCommon

func (HelperCommon) GetLineno

func (h HelperCommon) GetLineno() int

type If

type If struct {
	Test Node
	Body []Node
	Elif []If
	Else []Node
	StmtCommon
}

func (*If) SetCtx

func (i *If) SetCtx(ctx string)

type Import

type Import struct {
	Template    Expr
	WithContext bool
	Target      string
	StmtCommon
}

func (*Import) SetCtx

func (i *Import) SetCtx(ctx string)

func (*Import) SetWithContext

func (i *Import) SetWithContext(b bool)

type Include

type Include struct {
	Template      Expr
	WithContext   bool
	IgnoreMissing bool
	StmtCommon
}

func (*Include) SetCtx

func (i *Include) SetCtx(ctx string)

func (*Include) SetWithContext

func (i *Include) SetWithContext(b bool)

type Keyword

type Keyword struct {
	Key   string
	Value Expr
	HelperCommon
}

func (*Keyword) SetCtx

func (k *Keyword) SetCtx(ctx string)

type List

type List struct {
	Items []Expr
	LiteralCommon
}

func (*List) SetCtx

func (l *List) SetCtx(ctx string)

type Literal

type Literal Expr

type LiteralCommon

type LiteralCommon ExprCommon

func (LiteralCommon) CanAssign

func (LiteralCommon) CanAssign() bool

func (LiteralCommon) GetLineno

func (l LiteralCommon) GetLineno() int

type Macro

type Macro struct {
	Name string
	Body []Node
	MacroCall
	StmtCommon
}

func (*Macro) SetCtx

func (m *Macro) SetCtx(ctx string)

type MacroCall

type MacroCall struct {
	Args     []Name
	Defaults []Expr
}

type NSRef

type NSRef struct {
	Name string
	Attr string
	ExprCommon
}

func (NSRef) CanAssign

func (n NSRef) CanAssign() bool

func (NSRef) GetName

func (n NSRef) GetName() string

func (NSRef) SetCtx

func (n NSRef) SetCtx(string)

type Name

type Name struct {
	Name string
	Ctx  string
	ExprCommon
}

func (Name) CanAssign

func (n Name) CanAssign() bool

func (Name) GetName

func (n Name) GetName() string

func (*Name) SetCtx

func (n *Name) SetCtx(ctx string)

type Node

type Node interface {
	GetLineno() int
	SetCtx(ctx string)
}

type NodeCommon

type NodeCommon struct {
	Lineno int
}

func (*NodeCommon) GetLineno

func (n *NodeCommon) GetLineno() int

type Operand

type Operand struct {
	Op   string
	Expr Node
	HelperCommon
}

func (*Operand) SetCtx

func (o *Operand) SetCtx(ctx string)

type Output

type Output struct {
	Nodes []Expr
	StmtCommon
}

func (*Output) GetNodes

func (o *Output) GetNodes() []Expr

func (*Output) SetCtx

func (o *Output) SetCtx(ctx string)

type Pair

type Pair struct {
	Key   Expr
	Value Expr
	HelperCommon
}

func (*Pair) SetCtx

func (p *Pair) SetCtx(ctx string)

type Scope

type Scope struct {
	Body []Node
	StmtCommon
}

func (*Scope) SetCtx

func (s *Scope) SetCtx(ctx string)

type ScopedEvalContextModifier

type ScopedEvalContextModifier struct {
	Body []Node
	EvalContextModifier
}

func (*ScopedEvalContextModifier) SetCtx

func (s *ScopedEvalContextModifier) SetCtx(ctx string)

type SetWithContexter

type SetWithContexter interface {
	SetWithContext(bool)
	Stmt
}

type Slice

type Slice struct {
	Start *Expr
	Stop  *Expr
	Step  *Expr
	ExprCommon
}

func (*Slice) SetCtx

func (s *Slice) SetCtx(ctx string)

type Stmt

type Stmt interface {
	Node
}

type StmtCommon

type StmtCommon NodeCommon

func (*StmtCommon) GetLineno

func (s *StmtCommon) GetLineno() int

type StmtWithNodes

type StmtWithNodes interface {
	GetNodes() []Expr
	Stmt
}

type Template

type Template struct {
	Body []Node
	NodeCommon
}

func (*Template) SetCtx

func (t *Template) SetCtx(ctx string)

type TemplateData

type TemplateData struct {
	Data string
	LiteralCommon
}

TemplateData represents a constant template string.

func (*TemplateData) SetCtx

func (t *TemplateData) SetCtx(string)

type Test

type Test struct {
	FilterTestCommon
}

type Tuple

type Tuple struct {
	Items []Expr
	Ctx   string
	LiteralCommon
}

func (*Tuple) SetCtx

func (t *Tuple) SetCtx(ctx string)

type UnaryExpr

type UnaryExpr struct {
	Node Expr
	Op   string // same as lexer.TokenAdd etc. + "not"
	ExprCommon
}

func (*UnaryExpr) SetCtx

func (u *UnaryExpr) SetCtx(ctx string)

type With

type With struct {
	Targets []Expr
	Values  []Expr
	Body    []Node
	StmtCommon
}

func (*With) SetCtx

func (w *With) SetCtx(ctx string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL