mbbsemu / MBBSEmu

The MajorBBS Emulation Project is an Open Source, Cross-Platform emulator for easily running The MajorBBS & Worldgroup Modules
https://www.mbbsemu.com
MIT License
134 stars 13 forks source link

Fix MSG parse issue with CPTDTXT.MSG #557

Closed paladine closed 2 years ago

paladine commented 2 years ago

MSG parsing code would enter a junk state when encountering a \r\n immediately after an identifier, but it should allow the transition to the SPACE state instead. Technically \r\n are space characters after all.

enusbaum commented 2 years ago

This would undo #481

We might need to add some logic to evaluate if an identifier has been extracted (is the \r\n before or after) as the two cases seem distinct.

enusbaum commented 2 years ago

Also I'm wondering if we should abstract out the parser to have a similar Tick() command (Step()?) for parsing, as it would allow us to pass in potentially a string/file and Unit Test state given a specific scenario.

enusbaum commented 2 years ago

Re-Wrote the MSG File Loader/Parser. It's much more flexible now and also supports Unit/Integration testing. I tested this PR on TSGARN, WCCMMUD, and CPTDAWN and it loads all the MSG file values properly.