1
0
mirror of https://github.com/danog/liquid.git synced 2024-12-11 16:50:38 +01:00
liquid/parser/grammar.go

22 lines
526 B
Go
Raw Normal View History

2017-07-07 11:41:37 +02:00
package parser
2017-07-05 15:51:21 +02:00
2017-07-05 16:37:46 +02:00
// Grammar supplies the parser with syntax information about blocks.
2017-07-05 15:51:21 +02:00
type Grammar interface {
BlockSyntax(string) (BlockSyntax, bool)
}
2017-07-05 16:37:46 +02:00
// BlockSyntax supplies the parser with syntax information about blocks.
2017-07-05 15:51:21 +02:00
type BlockSyntax interface {
IsBlock() bool
CanHaveParent(BlockSyntax) bool
IsBlockEnd() bool
IsBlockStart() bool
IsClause() bool
2017-07-05 15:51:21 +02:00
ParentTags() []string
RequiresParent() bool
TagName() string
}
2017-07-05 16:37:46 +02:00
// Grammar returns a configuration's grammar.
2017-07-07 11:41:37 +02:00
// func (c *Config) Grammar() Grammar { return c }