|
|
@ -288,15 +288,25 @@ const visitors = {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
IfBlock(node, context) {
|
|
|
|
IfBlock(node, context) {
|
|
|
|
|
|
|
|
if (node.elseif) {
|
|
|
|
|
|
|
|
context.write('{:else if ');
|
|
|
|
|
|
|
|
context.visit(node.test);
|
|
|
|
|
|
|
|
context.write('}');
|
|
|
|
|
|
|
|
context.visit(node.consequent);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
context.write('{#if ');
|
|
|
|
context.write('{#if ');
|
|
|
|
context.visit(node.test);
|
|
|
|
context.visit(node.test);
|
|
|
|
context.write('}');
|
|
|
|
context.write('}');
|
|
|
|
|
|
|
|
|
|
|
|
context.visit(node.consequent);
|
|
|
|
context.visit(node.consequent);
|
|
|
|
|
|
|
|
if (node.alternate !== null) {
|
|
|
|
// TODO handle alternate/else if
|
|
|
|
if (!(node.alternate.type === 'IfBlock' && node.alternate.elseif)) {
|
|
|
|
|
|
|
|
context.write('{:else}');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
context.visit(node.alternate);
|
|
|
|
|
|
|
|
}
|
|
|
|
context.write('{/if}');
|
|
|
|
context.write('{/if}');
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
LetDirective(node, context) {
|
|
|
|
LetDirective(node, context) {
|
|
|
|