MCPcopy Index your code
hub / github.com/python/cpython / eval_line

Method eval_line

Lib/test/test_decimal.py:311–327  ·  view source on GitHub ↗
(self, s)

Source from the content-addressed store, hash-verified

309
310
311 def eval_line(self, s):
312 if s.find(' -> ') >= 0 and s[:2] != '--' and not s.startswith(' --'):
313 s = (s.split('->')[0] + '->' +
314 s.split('->')[1].split('--')[0]).strip()
315 else:
316 s = s.split('--')[0].strip()
317
318 for ignore in self.ignore_list:
319 if s.find(ignore) >= 0:
320 #print s.split()[0], 'NotImplemented--', ignore
321 return
322 if not s:
323 return
324 elif ':' in s:
325 return self.eval_directive(s)
326 else:
327 return self.eval_equation(s)
328
329 def eval_directive(self, s):
330 funct, value = (x.strip().lower() for x in s.split(':'))

Callers 1

eval_fileMethod · 0.95

Calls 6

eval_directiveMethod · 0.95
eval_equationMethod · 0.95
findMethod · 0.45
startswithMethod · 0.45
stripMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected