def test_no_flatten_or(self): matcher = Or('a', Join(Or('b', 'c'))) matcher.config.clear().flatten() parser = matcher.get_parse() text = str(parser.matcher) assert text == "Or(Literal, Transform)", text result = parser('abcd') assert result == ['a'], result
def test_nfa(self): first = Join(UnsignedFloat(), Any('eE'), SignedInteger()) second = UnsignedFloat() all = Or(first, second) all.config.clear().compile_to_nfa() m = all.get_parse()