rust-analyzer/crates/mbe/src
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
..
expander internal: make name consistent with usage 2021-09-06 18:34:03 +03:00
tests internal: more reasonable grammar for blocks 2021-09-26 19:16:09 +03:00
benchmark.rs internal: remove useless helpers 2021-08-09 15:58:21 +03:00
expander.rs Fix two more “a”/“an” typos (this time the other way) 2021-08-22 17:36:58 +02:00
lib.rs internal: make name consistent with usage 2021-09-06 18:34:03 +03:00
parser.rs clippy::redudant_borrow 2021-06-13 09:24:16 +05:30
subtree_source.rs Apply some clippy suggestions 2021-06-21 16:40:21 +02:00
syntax_bridge.rs Make hover work for intra doc links in macro invocations 2021-09-23 17:32:39 +02:00
tests.rs Only strip derive attributes when preparing macro input 2021-09-19 23:38:38 +02:00
token_map.rs Return all ranges corresponding to a token id in TokenMap 2021-08-29 00:49:57 +02:00
tt_iter.rs internal: make name consistent with usage 2021-09-06 18:34:03 +03:00