simon987 / Much-Assembly-Required

Assembly programming game
https://muchassemblyrequired.com
GNU General Public License v3.0
925 stars 87 forks source link

Updated parseDWInstruction to reduce complexity #240

Closed cathulhu closed 9 months ago

cathulhu commented 2 years ago

Per the complex method citation here:

https://www.codefactor.io/repository/github/simon987/much-assembly-required/issues/master

I've updated parseDWInstruction function to be shorter, more modular, and arguably easier to read and follow. Attempted to make code dryer without veering into being too esoteric.

Per contribution guidelines I've done manual string input output testing using a variety of valid and invalid syntax arguments and correct behavior observed where wrong number of tokens, invalid operations, and malformed expressions are appropriately identified and rejected.