We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b385c34 commit f08cdc4Copy full SHA for f08cdc4
1 file changed
src/crustache/syntax.cr
@@ -35,7 +35,7 @@ module Crustache::Syntax
35
node.to_code(io)
36
flag = true
37
end
38
- io << "] of Crustache::Syntax::Node)"
+ io << "] of ::Crustache::Syntax::Node)"
39
40
41
@@ -55,6 +55,23 @@ module Crustache::Syntax
55
{% for type in %w(Section Invert) %}
56
class {{ type.id }} < Template
57
include Tag
58
+
59
+ def initialize(@value : String, @content : [] of Node); end
60
61
+ macro def to_code(io) : Nil
62
+ io << "::\{{ @type.name.id }}.new("
63
+ @value.inspect io
64
+ io << ", ["
65
+ flag = false
66
+ @content.each do |node|
67
+ io << ", " if flag
68
+ node.to_code(io)
69
+ flag = true
70
+ end
71
72
+ io << ")"
73
+ nil
74
75
76
{% end %}
77
0 commit comments