Closed RetiredWizard closed 3 years ago
I've spotted this bug when loading some older programs with punctuation in remarks, so it's great to see someone tackling it.
I think your ideas will work, I don't think I was confident I knew everything lexer was doing when I made these changes so I added the extra logic (and variables) to ensure that I only modified the behavior of a statement whose first token was REM. Looking at it now, that doesn't look to be necessary. The loop format I used was lifted from the string token section but I agree your loop is clearer. I'll test out your mods next week and if they work out update the pull request. Even small reductions in memory usage are great news for running on the RP2040 :). Thanks!
I'll await an updated PR on this one then
Okay, this is much cleaner, thanks @brickbots ! By moving the remark consuming loop, I was even able to end the loops/routine through the normal flow without having to add an additional break or return :)
I did test this with my largest two program (adventure and startrek) and all seems to work fine.
This change will prevent mismatched quotes or unrecognized tokens on a REM statement from generating Syntax Errors