================== @if statement ================== @fn show(x: bool) { @if x {

Yes

} } --- (template (template_element (function_definition (identifier) (parameter_list (parameter (identifier) (rust_type (primitive_type)))) (content_block (template_node (template_control_flow (if_statement (expression (primary_expression (rust_path))) (content_block (template_node (html_element (tag_name) (template_node (text_content)) (tag_name))))))))))) ================== @for loop ================== @fn loop(items: Vec) { @for n in items {
  • @n
  • } } --- (template (template_element (function_definition (identifier) (parameter_list (parameter (identifier) (rust_type (generic_type (rust_path) (rust_type (primitive_type)))))) (content_block (template_node (template_control_flow (for_loop (simple_pattern (identifier_pattern (identifier))) (expression (primary_expression (rust_path))) (content_block (template_node (html_element (tag_name) (template_node (template_expression (simple_expression (expression_path (identifier))))) (tag_name))))))))))) ================== @match with literal and wildcard ================== @fn pick(v: u32) { @match v { 0 => {

    zero

    }, _ => {

    other

    } } } --- (template (template_element (function_definition (identifier) (parameter_list (parameter (identifier) (rust_type (primitive_type)))) (content_block (template_node (template_control_flow (match_statement (expression (primary_expression (rust_path))) (match_arm (pattern (literal (number_literal (integer_literal)))) (content_block (template_node (html_element (tag_name) (template_node (text_content)) (tag_name))))) (match_arm (pattern (wildcard_pattern)) (content_block (template_node (html_element (tag_name) (template_node (text_content)) (tag_name)))))))))))) ================== @if in HTML attribute position ================== @fn cb(active: bool) { } --- (template (template_element (function_definition (identifier) (parameter_list (parameter (identifier) (rust_type (primitive_type)))) (content_block (template_node (html_element (tag_name) (attribute_or_control (attribute_control_flow (attribute_if_statement (expression (primary_expression (rust_path))) (attribute_or_control (html_attribute (attribute_name))))))))))))