module Jikka.RestrictedPython.Convert.RemoveUnreachable
( run,
)
where
import Jikka.RestrictedPython.Language.Expr
import Jikka.RestrictedPython.Language.Util
runStatements :: [Statement] -> [Statement]
runStatements :: [Statement] -> [Statement]
runStatements [Statement]
stmts = case (Statement -> Bool) -> [Statement] -> ([Statement], [Statement])
forall a. (a -> Bool) -> [a] -> ([a], [a])
break Statement -> Bool
doesAlwaysReturn [Statement]
stmts of
([Statement]
stmts, []) -> [Statement]
stmts
([Statement]
stmts, Statement
stmt : [Statement]
_) -> [Statement]
stmts [Statement] -> [Statement] -> [Statement]
forall a. [a] -> [a] -> [a]
++ [Statement
stmt]
run :: Program -> Program
run :: Program -> Program
run = ([Statement] -> [Statement]) -> Program -> Program
mapStatements [Statement] -> [Statement]
runStatements