diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2021-09-26 12:12:57 +0300 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2021-09-26 19:16:09 +0300 |
| commit | 2bf81922f7d0b9042e64d298b2d6c5e6f3be3a61 (patch) | |
| tree | 55866a76e191f647a145f7a1ecbd4183fe1bcd55 /tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff | |
| parent | c51a3c78cfda0d0a83da8510d603c1bf136357b0 (diff) | |
| download | rust-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
