about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2021-09-26 12:12:57 +0300
committerAleksey Kladov <aleksey.kladov@gmail.com>2021-09-26 19:16:09 +0300
commit2bf81922f7d0b9042e64d298b2d6c5e6f3be3a61 (patch)
tree55866a76e191f647a145f7a1ecbd4183fe1bcd55 /tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff
parentc51a3c78cfda0d0a83da8510d603c1bf136357b0 (diff)
downloadrust-2bf81922f7d0b9042e64d298b2d6c5e6f3be3a61.tar.gz
rust-2bf81922f7d0b9042e64d298b2d6c5e6f3be3a61.zip
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
      { ... }
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff')
0 files changed, 0 insertions, 0 deletions