Пример #1
0
 def __str__(self) -> str:
     return short_name(self.name)
Пример #2
0
 def short_name(self) -> str:
     return short_name(self.name)
Пример #3
0
 def visit_dec_ref(self, op: DecRef) -> str:
     s = self.format('%sdec_ref %r', 'x' if op.is_xdec else '', op.src)
     # TODO: Remove bool check (it's unboxed)
     if is_bool_rprimitive(op.src.type) or is_int_rprimitive(op.src.type):
         s += ' :: {}'.format(short_name(op.src.type.name))
     return s
Пример #4
0
 def to_str(self, env: Environment) -> str:
     s = env.format('%sdec_ref %r', 'x' if self.is_xdec else '', self.src)
     if is_bool_rprimitive(self.src.type) or is_int_rprimitive(
             self.src.type):
         s += ' :: {}'.format(short_name(self.src.type.name))
     return s
Пример #5
0
 def visit_inc_ref(self, op: IncRef) -> str:
     s = self.format('inc_ref %r', op.src)
     # TODO: Remove bool check (it's unboxed)
     if is_bool_rprimitive(op.src.type) or is_int_rprimitive(op.src.type):
         s += ' :: {}'.format(short_name(op.src.type.name))
     return s