示例#1
0
 def __repr__(self): 
   if run_mode() is interactive:
     code = interactive_parser().parse(self)
     code = interactive_tagger().tag_loop_label(code)
     code = to_sexpression(code)
     result = interactive_solver().eval(code)
     return repr(result) if result is not None else ''
   else: return self.____repr____()
示例#2
0
文件: arith.py 项目: charyorde/dao
 def __repr__(self):
   if run_mode() is interactive:
     code = interactive_parser().parse(self)
     code = interactive_tagger().tag_loop_label(code)
     result = interactive_solver().eval(code)
     return repr(result) if result is not None else ''
   x = _operator_repr(self.operand[0], self.operator)
   return '%s%s'%(self.operator.symbol, x)
示例#3
0
文件: term.py 项目: charyorde/dao
 def __repr__(self): 
   if run_mode() is interactive:
     code = interactive_parser().parse(self)
     code = interactive_tagger().tag_loop_label(code)
     code = to_sexpression(code)
     result = interactive_solver().eval(code)
     return repr(result) if result is not None else ''
   return '%s(%s)'%(self.operator, 
               ','.join([repr(e) for e in self.operand]))
示例#4
0
文件: matcher.py 项目: charyorde/dao
 def __repr__(self):
   if run_mode() is interactive:
     code = interactive_parser().parse(self)
     code = interactive_tagger().tag_loop_label(code)
     result = interactive_solver().eval(code)
     return repr(result) if result is not None else '' if result is not None else ''
   return ''.join([repr(x) for x in 
         [self.item, self.separator, self.min, self.max, 
         self.template, self.result, self.mode]])
示例#5
0
文件: special.py 项目: charyorde/dao
 def __repr__(self): 
   if run_mode()==interactive:
     set_run_mode(noninteractive)
     code  = interactive_parser().parse(self.exp)
     code  = interactive_tagger().tag_loop_label(code)
     result = "%s"%code
     set_run_mode(interactive)
     return result
   else: 
     return "'%s"%self.exp