endlos99 / xdt99

xdt99: TMS 99xx Cross-Development Tools
http://endlos99.github.io/xdt99
GNU General Public License v3.0
52 stars 8 forks source link

Assignment variable misidentified in IF THEN statement in xbas99.py -c -l #42

Closed mcvde closed 1 year ago

mcvde commented 1 year ago

The following example shows two instances of the same problem:

[69] IF SP = 0 THEN SP = I Error: Unknown label SP [90] IF WPV = 0 THEN WPV = 1 :: WPH = 1 Error: Unknown label WPV

Removing the trailing space behind the variable being assigned a value eliminates the behavior. Correcting the input code to: IF SP = 0 THEN SP= I IF WPV = 0 THEN WPV= 1 :: WPH = 1

Note that in the second line, there are two assignments made; only the first assignment has this problem.

Appears the variable name collected in the bad condition includes a space.

This is a fine application and replaces a more crude version I wrote.

endlos99 commented 1 year ago

Thanks for your report! I think this happens because I don't really support spaces around '=' (and other operators). You basically have to enter BASIC programs like the LIST command would print them out.

But there is no reason why I shouldn't relax this -- in fact, I already did that for assembly and GPL, so I really should do it for BASIC as well.

I'll be working on this.

mcvde commented 1 year ago

Cool. That will be a very nice fix.

endlos99 commented 1 year ago

I've just pushed a new version of xbas99.py to the xdt99 repository. Please see this file for a description of the new features.

If everything is OK, I'll make a new release on the weekend.