Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def mapper(node):
if isinstance(node, d20.ast.Dice):
miX = d20.ast.SetOperator('mi', [d20.ast.SetSelector(None, int(minimum))])
return d20.ast.OperatedDice(node, miX)
return node
def _max_mapper(node):
"""A function that maps Dice AST objects to OperatedDice that set their values to their maximum."""
if isinstance(node, d20.ast.Dice):
miX = d20.ast.SetOperator('mi', [d20.ast.SetSelector(None, node.size)])
return d20.ast.OperatedDice(node, miX)
return node