This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

23 рядки
466 B

  1. from unittest import TestCase, main
  2. from lark import Lark, Tree
  3. class TestLexer(TestCase):
  4. def setUp(self):
  5. pass
  6. def test_basic(self):
  7. p = Lark("""
  8. start: "a" "b" "c" "d"
  9. %ignore " "
  10. """)
  11. res = list(p.lex("abc cba dd"))
  12. assert res == list('abccbadd')
  13. res = list(p.lex("abc cba dd", dont_ignore=True))
  14. assert res == list('abc cba dd')
  15. if __name__ == '__main__':
  16. main()