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
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|