public static BoundBlockStatement Lower(BoundStatement statement) { var lowerer = new Lowerer(); var result = lowerer.RewriteStatement(statement); return(Flatten(result)); }
public static BoundBlockStatement Lower(Symbol symbol, BoundStatement statement) { if (!(symbol is FunctionSymbol || symbol is ClassSymbol)) { throw new Exception($"Symbol of type {symbol.Kind} not expected in Lowerer."); } var lowerer = new Lowerer(); var result = lowerer.RewriteStatement(statement); return(RemoveDeadCode(Flatten(symbol, result))); }