nim-works / phy

compiler and vm experiments
MIT License
3 stars 2 forks source link

source2il: simpler `Expr` rules #49

Closed zerbina closed 1 month ago

zerbina commented 1 month ago

Summary

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

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)