zxbasic
zxbasic copied to clipboard
Removing inline IF functionality
Say I wanted to remove the inline IF functionality, particularly through commenting out lines 1381-1389 in src/zxbc/zxbparser.py. How would I do this or something with the same effect without making Python throw errors like crazy?
And why would you want to do that?
This will change the syntax of the language. Anyway, remove those lines and also the files in src/parsetab/tab*
. These files are autogenerated if they don't exist and must be deleted whenever you change the grammar.
Hello First of all, thank you for responding. I posted on the forum back in June, but it probably got buried. Well, the reason is that both Souls and Souls Remastered by Retrobytes Productions have ":rem" with comments after a few IF ... THEN statements, which seem to be detected as an inline IF (despite the comment having ":" in front so they should be treated as another line. These statements are not counted for the END IFs, and when the compiler reaches an END IF statement beyond the counted number, it throws an error. Sadly, not for every single instance. This was extremely annoying to diagnose and understand, mostly because the error wasn't on the same line as the problem. So I was hoping that, in order to make compiling easier for beginners, there would be an option (say -L for legacy) that would allow for compilation of these older codes, and would be prompted if this error ever appeared (and unprompted if an inline IF appeared). I was hoping to attempt this myself, but my python skills are nonexistant. OR the compiler could calculate the number of END IFs needed for both the presence and absence of inline IFs. But this would be harder to code. Anyways, this might be a useful feature, given that there might be more similarly incompatible software out there, as well as confused inexperienced users. And honestly, some teams could still be using older versions of the language because of these (and other) compatibility issues. Once again, thank you very much for responding. Sorry for the long post.