Andriamanitra / coctus

Command line tool for playing Clash of Code locally
MIT License
4 stars 2 forks source link

Crash when stubgen includes `gameloop` #50

Closed Andriamanitra closed 2 months ago

Andriamanitra commented 2 months ago

Describe the bug Turns out that even though the gameloop in Codingame stubs is intended for interactive puzzles, some clashes such as this Hanoi Tower one use it.

To Reproduce

clash fetch 5119910629a6bc760199c643306ecabb14c31
clash next 5119910629a6bc760199c643306ecabb14c31
clash generate-stub rust

Expected behavior At the very least the stub generator should not crash unexpectedly. I don't think it's necessary to make gameloop actually work; we could either simply exit with an error, or ignore it (and print a warning) and print the part of the stub that our stub generator can handle. Either way the Parser::parse method should probably return a Result instead of panicking.