2bf81922f7
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 { ... }
35 lines
840 B
Plaintext
35 lines
840 B
Plaintext
SOURCE_FILE@0..22
|
|
FN@0..21
|
|
FN_KW@0..2 "fn"
|
|
WHITESPACE@2..3 " "
|
|
NAME@3..6
|
|
IDENT@3..6 "foo"
|
|
PARAM_LIST@6..17
|
|
L_PAREN@6..7 "("
|
|
PARAM@7..13
|
|
IDENT_PAT@7..8
|
|
NAME@7..8
|
|
IDENT@7..8 "x"
|
|
COLON@8..9 ":"
|
|
WHITESPACE@9..10 " "
|
|
PATH_TYPE@10..13
|
|
PATH@10..13
|
|
PATH_SEGMENT@10..13
|
|
NAME_REF@10..13
|
|
IDENT@10..13 "i32"
|
|
COMMA@13..14 ","
|
|
WHITESPACE@14..15 " "
|
|
PARAM@15..16
|
|
IDENT_PAT@15..16
|
|
NAME@15..16
|
|
IDENT@15..16 "y"
|
|
R_PAREN@16..17 ")"
|
|
WHITESPACE@17..18 " "
|
|
BLOCK_EXPR@18..21
|
|
STMT_LIST@18..21
|
|
L_CURLY@18..19 "{"
|
|
WHITESPACE@19..20 "\n"
|
|
R_CURLY@20..21 "}"
|
|
WHITESPACE@21..22 "\n"
|
|
error 16..16: missing type for function parameter
|