1
0
mirror of https://github.com/danog/liquid.git synced 2025-01-08 12:28:16 +01:00
liquid/chunks/ast.go

39 lines
501 B
Go
Raw Normal View History

2017-06-26 15:36:52 +02:00
package chunks
2017-06-25 17:23:20 +02:00
import (
"io"
)
2017-06-26 18:41:41 +02:00
// ASTNode is a node of an AST.
type ASTNode interface {
2017-06-25 17:23:20 +02:00
Render(io.Writer, Context) error
}
type ASTSeq struct {
2017-06-26 18:41:41 +02:00
Children []ASTNode
2017-06-25 17:23:20 +02:00
}
type ASTChunks struct {
chunks []Chunk
}
2017-06-26 21:36:05 +02:00
type ASTGenericTag struct {
chunk Chunk
render func(io.Writer, Context) error
}
2017-06-25 17:23:20 +02:00
type ASTText struct {
chunk Chunk
}
type ASTObject struct {
chunk Chunk
}
type ASTControlTag struct {
chunk Chunk
cd *ControlTagDefinition
2017-06-26 18:41:41 +02:00
body []ASTNode
2017-06-25 17:23:20 +02:00
branches []*ASTControlTag
}