You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Historically, we struggled with formulating the right grammar for block
expressions. Today's EffectExpr is the best we've come up so far, but,
if you are thinking "WTF is an effect expression?", you are not wrong.
I think in this commit I've come up with what can be called a reasonable
grammar for block expressions. Observe that *all* things in `{}` we call
list: item list, assoc item list, match arm list, record field list,
record expr field list. In fact, `BlockExpr` is the only exception.
So, let's just call the stuff in `{}` a statement list. This isn't
forced: *all* things inside a block are statements, and `;` is a
statement separator, just like `,`. Trailing `;` is allowed, but not
required.
Then, statement list with modifiers such as `async` or attributes or
labels is just a block expression.
Why haven't I thought of it from the start?
0 commit comments