richpl / PyBasic

Simple interactive BASIC interpreter written in Python
GNU General Public License v3.0
165 stars 45 forks source link

Next clause parameter #53

Closed RetiredWizard closed 2 years ago

RetiredWizard commented 2 years ago

Addresses issue #52 "Next clause ignores its parameter".

Added the loop variable to the flowsignal class so that it could be utilized by the Program class.

Created a separate return stack (actually dictionary) for loops. I believe using a single stack for GOSUBS and loops might have been problematic if loops were exited using GOTO statements anyway.

Tested ok with regression, startrek and adventure.