concepts.dm.crow.crow_expression_utils.crow_replace_expression_variables#
- crow_replace_expression_variables(expr, mappings=None, ctx=None)[source]#
Replace variables in an expression with other expressions. Allowed replacements are:
Replace a
VariableExpression
with aVariable
or aValueOutputExpression
.Replace a
FunctionApplicationExpression
with aVariable
or aValueOutputExpression
.
- Parameters:
expr (Expression) – the expression to replace variables.
mappings (Dict[FunctionApplicationExpression | VariableExpression, Variable | ObjectOrValueOutputExpression] | None) – a dictionary of {expression: sub-expression} to replace the expression with the sub-expression.
ctx (ExpressionDefinitionContext | None) – a
ExpressionDefinitionContext
.
- Return type:
ObjectOrValueOutputExpression | VariableAssignmentExpression