コード例 #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
コード例 #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()
コード例 #3
0
ファイル: float_bug.py プロジェクト: cajus/python-lepl
 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()