Exemplo n.º 1
0
def _chr_to_value(c):
    if c == "n":
        return base_types.VNone()
    if c == "b":
        return base_types.VBool()
    if c == "i":
        return base_types.VInt()
    if c == "I":
        return base_types.VInt(64)
    raise ValueError
Exemplo n.º 2
0
 def _visit_expr_NameConstant(self, node):
     v = node.value
     if v is None:
         r = base_types.VNone()
     elif isinstance(v, bool):
         r = base_types.VBool()
     else:
         raise NotImplementedError
     if self.builder is not None:
         r.set_const_value(self.builder, v)
     return r