Ejemplo n.º 1
0
 def test_fails_to_parse(self):
     e = self.assertParseFailure(
         combinators.sep_by1(primitives.match(lambda c: c == ","),
                             primitives.match(lambda c: c == "h",
                                              {"error!"})),
         "ello")
     self.assertEqual({"error!"}, e.expected)
Ejemplo n.º 2
0
 def test_parse_some(self):
     self.assertParse(
         combinators.sep_by1(primitives.error({"error!"}),
                             primitives.match(lambda c: c == "h")),
         ["h"], "ello", "hello")
Ejemplo n.º 3
0
 def test_parses(self):
     self.assertParse(
         combinators.sep_by1(primitives.match(lambda c: c == ","),
                             primitives.match(lambda c: c == "h")),
         ["h", "h", "h"], "ello", "h,h,hello")