Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENDPROC-concatenation bug in PRES ABE Pack #7

Open
lurkio opened this issue Mar 23, 2023 · 0 comments
Open

ENDPROC-concatenation bug in PRES ABE Pack #7

lurkio opened this issue Mar 23, 2023 · 0 comments

Comments

@lurkio
Copy link

lurkio commented Mar 23, 2023

I seem to have found an unfortunate bug in PRES ABE Pack, which hence also affects basictool.

If you say Yes to all the Pack options (including Concatenate) and pack the following program...

10DEFPROCa:PRINT"In PROCa":ENDPROC
20PROCa:PRINT"Outside PROCa"

...then PRES ABE Pack will turn it into this...

10DEFPROCa:PRINT"In PROCa":ENDPROC:PROCa:PRINT"Outside PROCa"

...which obviously (and undesirably) has different behaviour from the original program!

I wonder if basictool could check for this buggy ENDPROC-concatenation issue and spit out a warning if it occurs? Maybe basictool could internally generate the ASCII listing for the code, post-Packing, and search each line for ENDPROC followed by optional spaces, a colon, and more code on the same line? (Or maybe it would be easier to search the tokenised form of the program instead -- but I didn't want to suggest that because of the risk of finding false positives..?)

(What's weird is that I didn't run into this problem until recently, when I added PROCa at the start of G.HAMP01 (click "Display"): http://bbcmicro.co.uk/explore.php?id=3199 Till then, there were seemingly dozens of PROCs (scroll down that page) which PRES ABE Pack concatenated correctly, without any issues! Obviously I must have hit a particular set of circumstances that triggered the bug with PROCa. (My workaround, btw, is to add a colon followed by an asterisk after the ENDPROC of PROCa! That prevents PRES ABE Pack from trying to concatenate it.))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant