Jikka-5.6.0.0: A transpiler from Python to C++ for competitive programming
Safe HaskellNone
LanguageHaskell2010

Jikka.RestrictedPython.Language.Util

Synopsis

generating symbols

free variables

freeVars :: Expr' -> [VarName] Source #

freeVars` reports all free variables.

freeVars' :: Expr' -> [VarName'] Source #

freeVars` reports all free variables with their locations, i.e. occurrences. For examples, x + x and x have the same free variables x but they have different sets of occurrences of free variable.

return-statements

traversing statements

mapStatementM :: Monad m => (Statement -> m [Statement]) -> Program -> m Program Source #

mapStatementM replaces all statements in a given program using a given function. This may breaks various constraints.

traversing sub exprs

mapSubExprM :: Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' Source #

mapSubExprM replaces all exprs in a given expr using a given function. This may breaks various constraints.

traversing exprs

mapExprM :: Monad m => (Expr' -> m Expr') -> Program -> m Program Source #

exprs

isSmallExpr :: Expr' -> Bool Source #

isSmallExpr is true if the evaluation of a given expr trivially terminates.

targets

programs

variable names