|
|
@ -12,15 +12,7 @@ export function IfBlock(node, context) {
|
|
|
|
validate_block_not_empty(node.alternate, context);
|
|
|
|
validate_block_not_empty(node.alternate, context);
|
|
|
|
|
|
|
|
|
|
|
|
if (context.state.analysis.runes) {
|
|
|
|
if (context.state.analysis.runes) {
|
|
|
|
const parent = context.path.at(-1);
|
|
|
|
validate_opening_tag(node, context.state, node.elseif ? ':' : '#');
|
|
|
|
const expected =
|
|
|
|
|
|
|
|
context.path.at(-2)?.type === 'IfBlock' &&
|
|
|
|
|
|
|
|
parent?.type === 'Fragment' &&
|
|
|
|
|
|
|
|
parent.nodes.length === 1
|
|
|
|
|
|
|
|
? ':'
|
|
|
|
|
|
|
|
: '#';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
validate_opening_tag(node, context.state, expected);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mark_subtree_dynamic(context.path);
|
|
|
|
mark_subtree_dynamic(context.path);
|
|
|
|