Esempio n. 1
0
 def test_parse_some(self):
     self.assertParse(
         combinators.sep_by(primitives.error({"error!"}),
                            primitives.match(lambda c: c == "h")),
         ["h"], "ello", "hello")
Esempio n. 2
0
 def test_parses_none_2(self):
     self.assertParse(
         combinators.sep_by(primitives.match(lambda c: c == ","),
                            primitives.error({"error!"})),
         [], "hello", "hello")
Esempio n. 3
0
 def test_parses_none(self):
     self.assertParse(
         combinators.sep_by(primitives.match(lambda c: c == ","),
                            primitives.match(lambda c: c == "h")),
         [], "ello", "ello")