This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

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