def check_fail(text): try: grammar.process(text) except: pass else: grammar.process(text, debug=True) raise Exception('was supposed to fail on \'%s\'' % text.encode('string_escape'))
def check_parse(text): try: return grammar.process(text) except: return grammar.process(text, debug=True)
def meta(self, *a, **b): result = grammar.process(text) self.assertEquals(str(result), text)