Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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()
Exemplo n.º 3
0
 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()