示例#1
0
文件: cirparser.py 项目: B-Rich/pykit
 def visit_Constant(self, node):
     type = self.type_env[node.type]
     const = types.convert(node.value, types.resolve_typedef(type))
     if isinstance(const, basestring):
         const = const[1:-1] # slice away quotes
     return Const(const)
示例#2
0
文件: interp.py 项目: aburan28/pykit
 def convert(self, arg):
     return types.convert(arg, self.op.type)
示例#3
0
 def visit_Constant(self, node):
     type = self.type_env[node.type]
     const = types.convert(node.value, types.resolve_typedef(type))
     if isinstance(const, basestring):
         const = const[1:-1]  # slice away quotes
     return Const(const)
示例#4
0
 def convert_args(self, args):
     return [types.convert(arg, argtype)
                 for arg, argtype in zip(args, self.f.type.argtypes)]
示例#5
0
 def visit_Constant(self, node):
     type = self.type_env[node.type]
     const = types.convert(node.value, type)
     return Const(const)
示例#6
0
文件: interp.py 项目: inaimathi/pykit
 def convert(self, arg):
     return types.convert(arg, self.op.type)
示例#7
0
 def visit_Constant(self, node):
     type = self.type_env[node.type]
     const = types.convert(node.value, type)
     return Const(const)