mirror of https://github.com/lark-parser/lark.git
Add test for multi-include
This commit is contained in:
parent
1bf1c1f0f9
commit
ceae390650
|
@ -1 +1 @@
|
||||||
Subproject commit 0abb6e5feef2f4ebf80d5a0891c1ad709011b1c7
|
Subproject commit 7a13cbd325b1854b83dfe060224a2a4be5b04701
|
|
@ -45,6 +45,20 @@ class TestNearley(unittest.TestCase):
|
||||||
parse('a')
|
parse('a')
|
||||||
parse('b')
|
parse('b')
|
||||||
|
|
||||||
|
def test_multi_include(self):
|
||||||
|
fn = os.path.join(NEARLEY_PATH, 'test/grammars/multi-include-test.ne')
|
||||||
|
with open(fn) as f:
|
||||||
|
grammar = f.read()
|
||||||
|
|
||||||
|
code = create_code_for_nearley_grammar(grammar, 'main', BUILTIN_PATH, os.path.dirname(fn))
|
||||||
|
d = {}
|
||||||
|
exec (code, d)
|
||||||
|
parse = d['parse']
|
||||||
|
|
||||||
|
parse('a')
|
||||||
|
parse('b')
|
||||||
|
parse('c')
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue