Remove the special case of the trailing statement in a void expression
having to be placed in the Expr.expr part, simplifying the exprToIL
post-conditions.
Details
require the expr part of Expr to be empty for void
expressions and non-empty for non-void expressions (except
tkError ones)
add assertions to verify that the post-conditions are satisfied
adjust the IL generation logic accordingly
move the Return void check to before expression fitting
In addition, genAsgn now ignores void expressions, so that one can
write
c.genAsgn(..., e.expr, e.typ, bu)
instead of
if e.typ.kind != tkVoid:
c.genAsgn(..., e.expr, e.typ, bu)
Summary
Remove the special case of the trailing statement in a void expression having to be placed in the
Expr.expr
part, simplifying theexprToIL
post-conditions.Details
expr
part ofExpr
to be empty forvoid
expressions and non-empty for non-void
expressions (excepttkError
ones)Return
void check to before expression fittingIn addition,
genAsgn
now ignores void expressions, so that one can writeinstead of