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

Removing inline IF functionality #628

Open
MrKOSMOS opened this issue Oct 24, 2022 · 2 comments
Open

Removing inline IF functionality #628

MrKOSMOS opened this issue Oct 24, 2022 · 2 comments

Comments

@MrKOSMOS
Copy link

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?

@boriel
Copy link
Collaborator

boriel commented Dec 6, 2022

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.

@MrKOSMOS
Copy link
Author

MrKOSMOS commented Dec 7, 2022

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.

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

2 participants