forked from Joker/jade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
142 lines (125 loc) · 3.34 KB
/
config.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package jade
var (
// Pretty print if true
PrettyOutput = true
// Output indent strring for pretty print
OutputIndent = " "
// Tabulation size of parse file
TabSize = 4
// Left go-template delim
LeftDelim = "{{"
// Right go-template delim
RightDelim = "}}"
)
const (
nestIndent = true
lineIndent = false
tabComment = "//-"
htmlComment = "//"
interDelim = "#{"
unEscInterDelim = "!{"
rightInterDelim = "}"
)
var itemToStr = map[itemType]string{
itemError: "itemError",
itemEOF: "itemEOF",
itemEndL: "itemEndL",
itemEndTag: "itemEndTag",
itemEndAttr: "itemEndAttr",
itemIdentSpace: "itemIdentSpace",
itemIdentTab: "itemIdentTab",
itemTag: "itemTag",
itemDiv: "itemDiv",
itemInlineTag: "itemInlineTag",
itemVoidTag: "itemVoidTag",
itemInlineVoidTag: "itemInlineVoidTag",
itemComment: "itemComment",
itemID: "itemID",
itemClass: "itemClass",
itemAttr: "itemAttr",
itemAttrN: "itemAttrN",
itemAttrName: "itemAttrName",
itemAttrVoid: "itemAttrVoid",
itemParentIdent: "itemParentIdent",
itemChildIdent: "itemChildIdent",
itemText: "itemText",
itemEmptyLine: "itemEmptyLine",
itemInlineText: "itemInlineText",
itemHTMLTag: "itemHTMLTag",
itemDoctype: "itemDoctype",
itemBlank: "itemBlank",
itemFilter: "itemFilter",
itemAction: "itemAction",
itemActionEnd: "itemActionEnd",
itemInlineAction: "itemInlineAction",
itemExtends: "itemExtends",
itemDefine: "itemDefine",
itemBlock: "itemBlock",
itemElse: "itemElse",
itemEnd: "itemEnd",
itemIf: "itemIf",
itemRange: "itemRange",
itemNil: "itemNil",
itemTemplate: "itemTemplate",
itemWith: "itemWith",
}
var key = map[string]itemType{
"area": itemVoidTag,
"base": itemVoidTag,
"col": itemVoidTag,
"command": itemVoidTag,
"embed": itemVoidTag,
"hr": itemVoidTag,
"input": itemVoidTag,
"keygen": itemVoidTag,
"link": itemVoidTag,
"meta": itemVoidTag,
"param": itemVoidTag,
"source": itemVoidTag,
"track": itemVoidTag,
"wbr": itemVoidTag,
"template": itemAction,
"end": itemAction,
"include": itemAction,
"extends": itemExtends,
"block": itemBlock,
"mixin": itemDefine,
// "define": itemDefine,
// "block": itemActionEnd,
"define": itemActionEnd,
"if": itemActionEnd,
"else": itemActionEnd,
"range": itemActionEnd,
"with": itemActionEnd,
"each": itemActionEnd,
"for": itemActionEnd,
"while": itemActionEnd,
"unless": itemActionEnd,
"case": itemActionEnd,
// "if": itemIf,
// "else": itemElse,
// "end": itemEnd,
// "range": itemRange,
// "with": itemWith,
// "nil": itemNil,
// "template": itemTemplate,
"a": itemInlineTag,
"abbr": itemInlineTag,
"acronym": itemInlineTag,
"b": itemInlineTag,
"code": itemInlineTag,
"em": itemInlineTag,
"font": itemInlineTag,
"i": itemInlineTag,
"ins": itemInlineTag,
"kbd": itemInlineTag,
"map": itemInlineTag,
"samp": itemInlineTag,
"small": itemInlineTag,
"span": itemInlineTag,
"strong": itemInlineTag,
"sub": itemInlineTag,
"sup": itemInlineTag,
"br": itemInlineVoidTag,
"img": itemInlineVoidTag,
}