simon816 / Command-Block-Assembly

Compile high-level code into Minecraft commands
https://www.simon816.com/minecraft/assembler
MIT License
271 stars 29 forks source link

cannot import name 'LEXERS' from 'compiler.parser_gen' #10

Closed Commodoreprime closed 5 years ago

Commodoreprime commented 5 years ago

I cannot run compiler_main.py. The import file parser_gen (as far as I can tell) does not contain LEXERS. It is only referenced once in parser_.py which, when removed, causes more problems (I'm not even sure what the for loop it is part of does, but that is beside the point). I have installed lark-parser and ran ./compiler/rebuild-grammar.sh as per README-C.

I figure I might want to bring this to attention, maybe it's in there by accident? I suspect that it was part of parser_gen.py before, but an update to lark removed it?

simon816 commented 5 years ago

I suspect Lark has changed the standalone generator and I need to update for it. I should've set the lark version to a specific release. Backdate to 0.6.7 and try again, modify requirements.txt to this:

lark-parser==0.6.7

and run pip install -r requirements.txt

Commodoreprime commented 5 years ago

Ok, that fixed it!

simon816 commented 5 years ago

I've fixed the problem so it should work with Lark 0.7.2 now https://github.com/simon816/Command-Block-Assembly/commit/e7b423768b12447474aedfd0a82e4ac018c9ee6d