1
0
mirror of https://github.com/danog/liquid.git synced 2024-12-02 15:27:46 +01:00
liquid/render/config.go

27 lines
546 B
Go
Raw Normal View History

2017-07-04 17:08:57 +02:00
package render
2017-07-07 11:41:37 +02:00
import (
"github.com/osteele/liquid/parser"
)
2017-07-04 17:08:57 +02:00
// Config holds configuration information for parsing and rendering.
type Config struct {
2017-07-07 11:41:37 +02:00
parser.Config
grammar
2020-11-03 01:36:02 +01:00
Cache map[string][]byte
}
type grammar struct {
2017-07-06 15:38:18 +02:00
tags map[string]TagCompiler
blockDefs map[string]*blockSyntax
2017-07-04 17:08:57 +02:00
}
// NewConfig creates a new Settings.
func NewConfig() Config {
g := grammar{
2017-07-06 15:38:18 +02:00
tags: map[string]TagCompiler{},
blockDefs: map[string]*blockSyntax{},
2017-07-04 17:08:57 +02:00
}
2020-11-03 01:36:02 +01:00
return Config{Config: parser.NewConfig(g), grammar: g, Cache: map[string][]byte{}}
2017-07-04 17:08:57 +02:00
}