-
-
Notifications
You must be signed in to change notification settings - Fork 274
/
structure.go
41 lines (38 loc) · 1.05 KB
/
structure.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
package parser
// TemplateFileNodes are the top level nodes of a templ file.
var (
// css name() { ... }
_ TemplateFileNode = CSSTemplate{}
// templ name() { ... }
_ TemplateFileNode = HTMLTemplate{}
// script name() { ... }
_ TemplateFileNode = ScriptTemplate{}
// Go code within a templ file.
_ TemplateFileNode = TemplateFileGoExpression{}
)
// Nodes are all the nodes you can find in a `templ` component.
var (
_ Node = Text{}
_ Node = Element{}
_ Node = RawElement{}
_ Node = GoComment{}
_ Node = HTMLComment{}
_ Node = CallTemplateExpression{}
_ Node = TemplElementExpression{}
_ Node = ChildrenExpression{}
_ Node = IfExpression{}
_ Node = SwitchExpression{}
_ Node = ForExpression{}
_ Node = StringExpression{}
_ Node = Whitespace{}
_ Node = DocType{}
)
// Element nodes can have the following attributes.
var (
_ Attribute = BoolConstantAttribute{}
_ Attribute = ConstantAttribute{}
_ Attribute = BoolExpressionAttribute{}
_ Attribute = ExpressionAttribute{}
_ Attribute = SpreadAttributes{}
_ Attribute = ConditionalAttribute{}
)