Jikka-5.6.0.0: A transpiler from Python to C++ for competitive programming
Copyright(c) Kimiyuki Onaka 2021
LicenseApache License 2.0
Maintainerkimiyuki95@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Jikka.RestrictedPython.Convert.RemoveUnreachable

Description

 
Synopsis

Documentation

run :: Program -> Program Source #

run removes unreachable statements after return-statements.

For example, the following

a = 0
if True:
    b = 0
    return b
    b += 1
else:
    return 1
a += 1

is converted to

a = 0
if True:
    b = 0
    return b
else:
    return 1