Exemplo n.º 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____()
Exemplo n.º 2
0
 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)
Exemplo n.º 3
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 ''
   return '%s(%s)'%(self.operator, 
               ','.join([repr(e) for e in self.operand]))
Exemplo n.º 4
0
 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]])
Exemplo n.º 5
0
 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
Exemplo n.º 6
0
def solve(exp):
    code = interactive_parser().parse(exp)
    code = interactive_tagger().tag_loop_label(code)
    code = to_sexpression(code)
    return interactive_solver().solve(code)
Exemplo n.º 7
0
def solve(exp):
  code = interactive_parser().parse(exp)
  code = interactive_tagger().tag_loop_label(code)
  code = to_sexpression(code)
  return interactive_solver().solve(code)