示例#1
0
 def test_functions(self):
     t = make_paired_tokens(scan("log(7)"))
     s = [['N', '*', '5'], ['N', '*', '7'], ['Z', '*', '']]
     self.assertEqual(t, s, 'problem with function calls')
示例#2
0
 def test_comments(self):
     t = make_paired_tokens(scan("5 + 6 # + 56"))
     s = [['N', '*', '5'], ['N', '+', '6'], ['Z', '*', '']]
     self.assertEqual(t, s, 'problem with comments')
示例#3
0
 def test_implied_multiplication(self):
     t = make_paired_tokens(scan("5 7"))
     s = [['N', '*', '5'], ['N', '*', '7'], ['Z', '*', '']]
     self.assertEqual(t, s, 'problem with implied multiplication')