def typer(hint): """ :param lal.AdaNode hint: the lal type. :return: The corresponding lalcheck type. :rtype: types.Boolean | types.IntRange """ if hint == bool_type: return types.Boolean() elif hint == int_type: return types.IntRange(-2 ** 31, 2 ** 31 - 1) elif hint == char_type: return types.ASCIICharacter()
def to_int_range(xs): return types.IntRange(*xs)
def to_int_range(modulus): return types.IntRange(0, modulus - 1)