rust/crates/syntax/test_data/parser/ok
Aleksey Kladov 2bf81922f7 internal: more reasonable grammar for blocks
Consider these expples

        { 92 }
  async { 92 }
    'a: { 92 }
   #[a] { 92 }

Previously the tree for them were

  BLOCK_EXPR
    { ... }

  EFFECT_EXPR
    async
    BLOCK_EXPR
      { ... }

  EFFECT_EXPR
    'a:
    BLOCK_EXPR
      { ... }

  BLOCK_EXPR
    #[a]
    { ... }

As you see, it gets progressively worse :) The last two items are
especially odd. The last one even violates the balanced curleys
invariant we have (#10357) The new approach is to say that the stuff in
`{}` is stmt_list, and the block is stmt_list + optional modifiers

  BLOCK_EXPR
    STMT_LIST
      { ... }

  BLOCK_EXPR
    async
    STMT_LIST
      { ... }

  BLOCK_EXPR
    'a:
    STMT_LIST
      { ... }

  BLOCK_EXPR
    #[a]
    STMT_LIST
      { ... }
2021-09-26 19:16:09 +03:00
..
0000_empty.rast
0000_empty.rs
0001_struct_item.rast
0001_struct_item.rs
0002_struct_item_field.rast
0002_struct_item_field.rs
0004_file_shebang.rast
0004_file_shebang.rs
0005_fn_item.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0005_fn_item.rs
0006_inner_attributes.rast Update ungrammar 2021-06-11 18:34:30 +02:00
0006_inner_attributes.rs
0007_extern_crate.rast
0007_extern_crate.rs
0008_mod_item.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0008_mod_item.rs internal: more local test for mod item 2021-09-17 21:53:24 +03:00
0009_use_item.rast
0009_use_item.rs
0010_use_path_segments.rast
0010_use_path_segments.rs
0011_outer_attribute.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0011_outer_attribute.rs internal: enforce no #[ignore] and no #[should_panic] 2021-06-15 16:54:43 +03:00
0012_visibility.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0012_visibility.rs internal: more local parsing tests for macros 2021-09-17 22:21:57 +03:00
0013_use_path_self_super.rast
0013_use_path_self_super.rs
0014_use_tree.rast
0014_use_tree.rs
0015_use_tree.rast
0015_use_tree.rs
0016_struct_flavors.rast
0016_struct_flavors.rs
0017_attr_trailing_comma.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0017_attr_trailing_comma.rs
0018_struct_type_params.rast Fix parser tests for 1.53 2021-06-17 18:09:44 +02:00
0018_struct_type_params.rs
0019_enums.rast
0019_enums.rs
0020_type_param_bounds.rast Fix parser tests for 1.53 2021-06-17 18:09:44 +02:00
0020_type_param_bounds.rs
0022_empty_extern_block.rast
0022_empty_extern_block.rs
0023_static_items.rast
0023_static_items.rs
0024_const_item.rast intenral: more local tests for statics 2021-09-18 01:02:43 +03:00
0024_const_item.rs intenral: more local tests for statics 2021-09-18 01:02:43 +03:00
0025_extern_fn_in_block.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0025_extern_fn_in_block.rs
0026_const_fn_in_block.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0026_const_fn_in_block.rs
0027_unsafe_fn_in_block.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0027_unsafe_fn_in_block.rs
0028_operator_binding_power.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0028_operator_binding_power.rs
0029_range_forms.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0029_range_forms.rs
0030_string_suffixes.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0030_string_suffixes.rs
0030_traits.rast
0030_traits.rs
0031_extern.rast
0031_extern.rs
0032_where_for.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0032_where_for.rs
0033_label_break.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0033_label_break.rs
0034_crate_path_in_call.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0034_crate_path_in_call.rs
0035_weird_exprs.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0035_weird_exprs.rs
0036_fully_qualified.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0036_fully_qualified.rs
0037_mod.rast
0037_mod.rs
0038_where_pred_type.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0038_where_pred_type.rs
0039_raw_fn_item.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0039_raw_fn_item.rs
0040_raw_struct_item_field.rast
0040_raw_struct_item_field.rs
0041_raw_keywords.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0041_raw_keywords.rs
0042_ufcs_call_list.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0042_ufcs_call_list.rs
0043_complex_assignment.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0043_complex_assignment.rs
0044_let_attrs.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0044_let_attrs.rs
0045_block_attrs.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0045_block_attrs.rs
0046_extern_inner_attributes.rast Update ungrammar 2021-06-11 18:34:30 +02:00
0046_extern_inner_attributes.rs
0047_minus_in_inner_pattern.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0047_minus_in_inner_pattern.rs
0048_compound_assignment.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0048_compound_assignment.rs
0049_async_block.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0049_async_block.rs
0050_async_block_as_argument.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0050_async_block_as_argument.rs
0051_parameter_attrs.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0051_parameter_attrs.rs
0052_for_range_block.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0052_for_range_block.rs
0053_outer_attribute_on_macro_rules.rast Update ungrammar 2021-06-11 18:34:30 +02:00
0053_outer_attribute_on_macro_rules.rs
0054_qual_path_in_type_arg.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0054_qual_path_in_type_arg.rs
0055_dot_dot_dot.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0055_dot_dot_dot.rs
0056_neq_in_type.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0056_neq_in_type.rs
0057_loop_in_call.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0057_loop_in_call.rs
0058_unary_expr_precedence.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0058_unary_expr_precedence.rs
0059_loops_in_parens.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0059_loops_in_parens.rs
0060_as_range.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0060_as_range.rs
0061_match_full_range.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0061_match_full_range.rs
0062_macro_2.0.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0062_macro_2.0.rs
0063_trait_fn_patterns.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0063_trait_fn_patterns.rs
0063_variadic_fun.rast Update ungrammar 2021-06-11 18:34:30 +02:00
0063_variadic_fun.rs
0064_impl_fn_params.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0064_impl_fn_params.rs
0065_comment_newline.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0065_comment_newline.rs
0065_plus_after_fn_trait_bound.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0065_plus_after_fn_trait_bound.rs
0066_default_modifier.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0066_default_modifier.rs
0067_where_for_pred.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0067_where_for_pred.rs
0068_item_modifiers.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0068_item_modifiers.rs
0069_multi_trait_object.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0069_multi_trait_object.rs
0070_expr_attr_placement.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0070_expr_attr_placement.rs feat: allow attributes on all expressions 2021-09-25 22:19:27 +03:00
0071_stmt_attr_placement.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0071_stmt_attr_placement.rs feat: allow attributes on all expressions 2021-09-25 22:19:27 +03:00