コード例 #1
0
ファイル: maxdepth.py プロジェクト: alexmac/ifdef-refactor
    def test_location(self):
        matcher = FullFirstMatch(Any('a')[:] & Eos())
        matcher.config.clear()
        try:
            list(matcher.match_string('aab'))
            assert False, 'expected error'
        except FullFirstMatchException as e:
            assert str(e) == """The match failed at 'b',
Line 1, character 2 of str: 'aab'.""", str(e)
コード例 #2
0
ファイル: maxdepth.py プロジェクト: anonymouzz/lyx2ebook
    def test_location(self):
        matcher = FullFirstMatch(Any('a')[:] & Eos())
        matcher.config.clear()
        try:
            list(matcher.match_string('aab'))
            assert False, 'expected error'
        except FullFirstMatchException as e:
            assert str(e) == """The match failed at 'b',
Line 1, character 2 of str: 'aab'.""", str(e)
コード例 #3
0
ファイル: rewriters.py プロジェクト: anonymouzz/lyx2ebook
 def __call__(self, graph):
     from lepl.stream.maxdepth import FullFirstMatch
     return FullFirstMatch(graph, self.eos)
コード例 #4
0
ファイル: maxdepth.py プロジェクト: alexmac/ifdef-refactor
 def test_ok(self):
     matcher = FullFirstMatch(Any('a'))
     matcher.config.clear()
     result = list(matcher.match_null('a'))
     assert result == [(['a'], '')], result
コード例 #5
0
ファイル: maxdepth.py プロジェクト: anonymouzz/lyx2ebook
 def test_ok(self):
     matcher = FullFirstMatch(Any('a'))
     matcher.config.clear()
     result = list(matcher.match_null('a'))
     assert result == [(['a'], '')], result