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