rust-analyzer/crates/syntax/test_data/parser/err
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_struct_field_missing_comma.rast Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0000_struct_field_missing_comma.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0001_item_recovery_in_file.rast Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0001_item_recovery_in_file.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0002_duplicate_shebang.rast Move to upstream macro_rules! model 2020-12-15 15:37:37 +01:00
0002_duplicate_shebang.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0003_C++_semicolon.rast Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0003_C++_semicolon.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0004_use_path_bad_segment.rast Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0004_use_path_bad_segment.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0005_attribute_recover.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0005_attribute_recover.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0006_named_field_recovery.rast Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0006_named_field_recovery.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0007_stray_curly_in_file.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0007_stray_curly_in_file.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0008_item_block_recovery.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0008_item_block_recovery.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0009_broken_struct_type_parameter.rast feat: allow attributes on all expressions 2021-09-25 22:19:27 +03:00
0009_broken_struct_type_parameter.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0010_unsafe_lambda_block.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0010_unsafe_lambda_block.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0011_extern_struct.rast Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0011_extern_struct.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0012_broken_lambda.rast Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0013_invalid_type.rast Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0013_invalid_type.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0014_where_no_bounds.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0014_where_no_bounds.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0015_curly_in_params.rast Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0015_curly_in_params.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0016_missing_semi.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0016_missing_semi.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0017_incomplete_binexpr.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0017_incomplete_binexpr.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0018_incomplete_fn.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0018_incomplete_fn.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0019_let_recover.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0019_let_recover.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0020_fn_recover.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0020_fn_recover.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0021_incomplete_param.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0021_incomplete_param.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0022_bad_exprs.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0022_bad_exprs.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0023_mismatched_paren.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0023_mismatched_paren.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0024_many_type_parens.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0024_many_type_parens.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0025_nope.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0025_nope.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0026_imp_recovery.rast Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0026_imp_recovery.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0027_incomplere_where_for.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0027_incomplere_where_for.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0029_field_completion.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0029_field_completion.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0031_block_inner_attrs.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0031_block_inner_attrs.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0032_match_arms_inner_attrs.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0032_match_arms_inner_attrs.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0033_match_arms_outer_attrs.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0033_match_arms_outer_attrs.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0034_bad_box_pattern.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0034_bad_box_pattern.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0035_use_recover.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0035_use_recover.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0036_partial_use.rast Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0036_partial_use.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0037_visibility_in_traits.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0037_visibility_in_traits.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0038_endless_inclusive_range.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0038_endless_inclusive_range.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0039_lambda_recovery.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0039_lambda_recovery.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0040_illegal_crate_kw_location.rast Handle self/super/crate in PathSegment as NameRef 2021-01-15 19:21:23 +01:00
0040_illegal_crate_kw_location.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0041_illegal_super_keyword_location.rast Handle self/super/crate in PathSegment as NameRef 2021-01-15 19:21:23 +01:00
0041_illegal_super_keyword_location.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0042_illegal_self_keyword_location.rast Handle self/super/crate in PathSegment as NameRef 2021-01-15 19:21:23 +01:00
0042_illegal_self_keyword_location.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0043_weird_blocks.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0043_weird_blocks.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0044_unexpected_for_type.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0044_unexpected_for_type.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0045_item_modifiers.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0045_item_modifiers.rs Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
0046_ambiguous_trait_object.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0046_ambiguous_trait_object.rs Add validation check for ambiguous trait objects 2020-10-06 23:52:00 +02:00
0047_mutable_const_item.rast Add validation for mutable const items 2021-01-24 02:17:41 +01:00
0047_mutable_const_item.rs Add validation for mutable const items 2021-01-24 02:17:41 +01:00
0048_repated_extern_modifier.rast fix: avoid panic when parsing extern block 2021-08-30 15:40:47 +03:00
0048_repated_extern_modifier.rs fix: avoid panic when parsing extern block 2021-08-30 15:40:47 +03:00
0049_double_fish.rast internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
0049_double_fish.rs internal: add erroneous test for double turbo fish 2021-09-19 11:42:10 +03:00