Exemple #1
0
        public static BoundBlockStatement Lower(BoundStatement statement)
        {
            var lowerer = new Lowerer();
            var result  = lowerer.RewriteStatement(statement);

            return(Flatten(result));
        }
Exemple #2
0
        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)));
        }