Fix: postfix expr on statement bodies

This commit is contained in:
2026-06-15 16:32:52 +02:00
parent f45d83d261
commit 48e3522543
+4 -8
View File
@@ -565,13 +565,14 @@ decrement = {
"--"
}
postfix_no_struct = _{
postfix = {
field_px
| tuple_field_px
| call_px
| macro_call_paren
| macro_call_bracket
| macro_call_brace
| struct_px
| index_px
| as_px
| try_px
@@ -579,11 +580,6 @@ postfix_no_struct = _{
| decrement
}
postfix = {
postfix_no_struct
| struct_px
}
// ------------------------------------------------------
// PREFIX EXPRESSIONS
// ------------------------------------------------------
@@ -649,6 +645,6 @@ expr = { term ~ (bin_op ~ term)* }
term = { prefix* ~ primary ~ postfix* }
expr_no_struct = { term_no_struct ~ (bin_op ~ term)* }
expr_no_struct = { term_no_struct ~ (bin_op ~ term_no_struct)* }
term_no_struct = { prefix* ~ primary ~ postfix_no_struct* }
term_no_struct = { prefix* ~ primary ~ (!struct_px ~ postfix)* }