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: Veczero
}, _ => {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)))))))))))) diff --git a/test/corpus/features.txt b/test/corpus/features.txt new file mode 100644 index 0000000..ceb354c --- /dev/null +++ b/test/corpus/features.txt @@ -0,0 +1,159 @@ +================== +format expression +================== + +@fn fmt(name: String) {@format("Hello {}", name)
} + +--- + +(template + (template_element + (function_definition + (identifier) + (parameter_list + (parameter + (identifier) + (rust_type + (primitive_type)))) + (content_block + (template_node + (html_element + (tag_name) + (template_node + (template_expression + (format_expression + (string_literal) + (expression + (primary_expression + (rust_path)))))) + (tag_name))))))) + +================== +matches expression +================== + +@fn check(v: Option@matches(v, Some(_))
} + +--- + +(template + (template_element + (function_definition + (identifier) + (parameter_list + (parameter + (identifier) + (rust_type + (generic_type + (rust_path) + (rust_type + (primitive_type)))))) + (content_block + (template_node + (html_element + (tag_name) + (template_node + (template_expression + (matches_expression + (expression + (primary_expression + (rust_path))) + (pattern + (tuple_variant_pattern + (rust_path) + (pattern + (wildcard_pattern))))))) + (tag_name))))))) + +================== +inferred enum path +================== + +@fn status(s: Status) {@(::Active)
} + +--- + +(template + (template_element + (function_definition + (identifier) + (parameter_list + (parameter + (identifier) + (rust_type + (path_type + (rust_path))))) + (content_block + (template_node + (html_element + (tag_name) + (template_node + (template_expression + (complex_expression + (expression + (primary_expression + (inferred_enum_path)))))) + (tag_name))))))) + +================== +inferred enum tuple variant +================== + +@fn call() {@(::Some(1))
} + +--- + +(template + (template_element + (function_definition + (identifier) + (parameter_list) + (content_block + (template_node + (html_element + (tag_name) + (template_node + (template_expression + (complex_expression + (expression + (primary_expression + (inferred_enum_call + (inferred_enum_path) + (argument_list + (expression + (primary_expression + (literal + (number_literal + (integer_literal)))))))))))) + (tag_name))))))) + +================== +inferred enum struct variant +================== + +@fn data() { @let x = ::User { name: "A" }; } + +--- + +(template + (template_element + (function_definition + (identifier) + (parameter_list) + (content_block + (template_node + (template_control_flow + (let_statement + (simple_pattern + (identifier_pattern + (identifier))) + (expression + (primary_expression + (inferred_enum_struct + (inferred_enum_path) + (struct_field_init + (identifier) + (expression + (primary_expression + (literal + (string_literal))))))))))))))) diff --git a/test/corpus/known_bugs.txt b/test/corpus/known_bugs.txt new file mode 100644 index 0000000..585fdb1 --- /dev/null +++ b/test/corpus/known_bugs.txt @@ -0,0 +1,25 @@ +================== +@let statement +================== + +@fn calc() { @let n = 42; } + +--- + +(template + (template_element + (function_definition + (identifier) + (parameter_list) + (content_block + (template_node + (template_control_flow + (let_statement + (simple_pattern + (identifier_pattern + (identifier))) + (expression + (primary_expression + (literal + (number_literal + (integer_literal))))))))))))