Ver a proveniência

Added a test suggested by James McLaughlin

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.5.1
Erez Shinan há 7 anos
ascendente
cometimento
ee8dd8b3f3
1 ficheiros alterados com 14 adições e 0 eliminações
  1. +14
    -0
      tests/test_parser.py

+ 14
- 0
tests/test_parser.py Ver ficheiro

@@ -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" """)


Carregando…
Cancelar
Guardar