소스 검색

Added a test suggested by James McLaughlin

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.5.1
Erez Shinan 7 년 전
부모
커밋
ee8dd8b3f3
1개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  1. +14
    -0
      tests/test_parser.py

+ 14
- 0
tests/test_parser.py 파일 보기

@@ -379,6 +379,20 @@ def _make_parser_test(LEXER, PARSER):
x = g.parse('Hello HelloWorld')
self.assertSequenceEqual(x.children, ['HelloWorld'])

def test_token_collision2(self):
# NOTE: This test reveals a bug in token reconstruction in Scanless Earley
# I probably need to re-write grammar transformation

g = _Lark("""
!start: "starts"

%import common.LCASE_LETTER
""")

x = g.parse("starts")
self.assertSequenceEqual(x.children, ['starts'])


# def test_string_priority(self):
# g = _Lark("""start: (A | /a?bb/)+
# A: "a" """)


불러오는 중...
취소
저장