This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

23 rader
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()