robhagemans / pcbasic

PC-BASIC - A free, cross-platform emulator for the GW-BASIC family of interpreters
http://www.pc-basic.org
Other
393 stars 48 forks source link

Auto dot #237

Open GBR-613 opened 5 months ago

GBR-613 commented 5 months ago

Fixing issue #230

robhagemans commented 5 months ago

Thanks for fixing this bug! I found a simpler approach (the main problem was that from_line was calculated but then ignored, along with the initial setting of last_stored to None).

I've taken your commit fixing PyLint warnings and will merge all or part of it - some things PyLint complains about are conscious coding style choices, but not all of it.

GBR-613 commented 5 months ago

@robhagemans I remember I tried to implement "from_line based" approach and found a scenario when the behavior was like I would expect yet different from GWBASIC, and ended up with this one. Unfortunately I don't remember that scenario. If I will succeed to reproduce I will report.

robhagemans commented 5 months ago

Thanks! Let me know if you find the scenario. One thing I noticed was that after the change , AUTO . if used on an empty program buffer would start at line number 10, whereas this should be line number 0. The change in initial value for last_stored deals with this, without AFAICS undesired side effects.

Actually I still need to create a test for the latter scenario.