-
Notifications
You must be signed in to change notification settings - Fork 0
/
syntax.go
35 lines (31 loc) · 904 Bytes
/
syntax.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package mjingo
// Syntax is the delimiter configuration for the environment and the parser.
//
// mjingo allows you to override the syntax configuration for
// templates by setting different delimiters. The end markers can
// be shared, but the start markers need to be distinct. It would
// thus not be valid to configure `{{` to be the marker for both
// variables and blocks.
type Syntax struct {
BlockStart string
BlockEnd string
VariableStart string
VariableEnd string
CommentStart string
CommentEnd string
}
// DefaultSyntax is the default delimiter configuration for the environment and the parser.
var DefaultSyntax = Syntax{
BlockStart: "{%",
BlockEnd: "%}",
VariableStart: "{{",
VariableEnd: "}}",
CommentStart: "{#",
CommentEnd: "#}",
}
type syntaxConfig struct {
Syntax Syntax
}
var defaultSyntaxConfig = syntaxConfig{
Syntax: DefaultSyntax,
}