mirror of https://github.com/lark-parser/lark.git
Cleaned up a test
This commit is contained in:
parent
be2e860c83
commit
505c46e9ba
|
@ -1,11 +1,9 @@
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
from unittest import TestCase, main
|
||||||
from unittest import TestCase
|
|
||||||
|
|
||||||
from lark.tree import Tree
|
from lark.tree import Tree
|
||||||
|
|
||||||
from lark.tools import standalone
|
from lark.tools import standalone
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -94,26 +92,19 @@ class TestStandalone(TestCase):
|
||||||
_NEWLINE: /\n/
|
_NEWLINE: /\n/
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# from lark import Lark
|
|
||||||
# l = Lark(grammar, parser='lalr', lexer='contextual', postlex=MyIndenter())
|
|
||||||
# x = l.parse('(\n)\n')
|
|
||||||
# print('@@', x)
|
|
||||||
|
|
||||||
|
|
||||||
context = self._create_standalone(grammar)
|
context = self._create_standalone(grammar)
|
||||||
_Lark = context['Lark_StandAlone']
|
_Lark = context['Lark_StandAlone']
|
||||||
|
|
||||||
# l = _Lark(postlex=MyIndenter())
|
l = _Lark(postlex=MyIndenter())
|
||||||
# x = l.parse('()\n')
|
x = l.parse('()\n')
|
||||||
# print(x)
|
self.assertEqual(x, Tree('start', []))
|
||||||
l = _Lark(postlex=MyIndenter())
|
l = _Lark(postlex=MyIndenter())
|
||||||
x = l.parse('(\n)\n')
|
x = l.parse('(\n)\n')
|
||||||
print(x)
|
self.assertEqual(x, Tree('start', []))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
main()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue