This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

22 righe
554 B

  1. from lark import Lark
  2. parser = Lark(open('examples/lark.lark'), parser="lalr")
  3. grammar_files = [
  4. 'examples/python2.lark',
  5. 'examples/python3.lark',
  6. 'examples/lark.lark',
  7. 'examples/relative-imports/multiples.lark',
  8. 'examples/relative-imports/multiple2.lark',
  9. 'examples/relative-imports/multiple3.lark',
  10. 'lark/grammars/common.lark',
  11. ]
  12. def test():
  13. for grammar_file in grammar_files:
  14. tree = parser.parse(open(grammar_file).read())
  15. print("All grammars parsed successfully")
  16. if __name__ == '__main__':
  17. test()