Пример #1
0
 def testParse(self):
     self.assertEqual(plugin.parse_scheme('(+ 11 12)')[0],
             ['+', '11', '12'])
     self.assertEqual(plugin.parse_scheme('(+ 5 4)')[0],
             ['+', '5', '4'])
     self.assertEqual(plugin.parse_scheme('(+ 5 (* 4 6))')[0],
         ['+', '5', ['*', '4', '6']])
Пример #2
0
 def testParse(self):
     self.assertEqual(plugin.parse_scheme("(+ 11 12)"), ["+", "11", "12"])
     self.assertEqual(plugin.parse_scheme("(+ 5 4)"), ["+", "5", "4"])
     self.assertEqual(plugin.parse_scheme("(+ 5 (* 4 6))"), ["+", "5", ["*", "4", "6"]])
     self.assertEqual(plugin.parse_scheme("((lambda x x) 1 2 3)")[1:], ["1", "2", "3"])
     self.assertEqual(
         plugin.parse_scheme("((lambda (x y) (+ x y)) 11 12)"), [["lambda", ["x", "y"], ["+", "x", "y"]], "11", "12"]
     )
Пример #3
0
 def testParse(self):
     self.assertEqual(plugin.parse_scheme('(+ 11 12)'), ['+', '11', '12'])
     self.assertEqual(plugin.parse_scheme('(+ 5 4)'), ['+', '5', '4'])
     self.assertEqual(plugin.parse_scheme('(+ 5 (* 4 6))'),
                      ['+', '5', ['*', '4', '6']])
     self.assertEqual(
         plugin.parse_scheme('((lambda x x) 1 2 3)')[1:], ['1', '2', '3'])
     self.assertEqual(plugin.parse_scheme('((lambda (x y) (+ x y)) 11 12)'),
                      [['lambda', ['x', 'y'], ['+', 'x', 'y']], '11', '12'])