-
Notifications
You must be signed in to change notification settings - Fork 237
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
Correct function definitions and 2.3 FancyRoomSelect #921
Conversation
Download the artifacts for this pull request here: GUI:
CLI: |
UndertaleModLib/Compiler/Parser.cs
Outdated
return result; | ||
if (expression) | ||
return result; | ||
else // Whatever you call non-anonymous |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Else is unnecessary here, due to the return from above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel that keeping both returns on the same level makes it clear at a glance that neither is especially a "default". You can't miss the if anymore and assume it always does the one thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is fair, I just dislike the nesting. Probably a better thing to have in this case though.
So, the reason why struct decompilation uses |
Oh, that worked pretty well. No more conflicts, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem to be.
Would still personally prefer to get rid of the else to reduce nesting, but that's not something that's merge blocking or anything.
Description
Adds support for
function scr_myscript()
formatting in GMS 2.3+ in both compilation and decompilation. Minor tweaks to FancyRoomSelect.csx to function on 2.3+ with strange room orders.Caveats
Struct definition isn't 100% due to me not knowing how struct definition works. The new decompiler code hackily uses
FunctionDefinition
as both an Expression and a Statement depending on context. The code does not differentiate in decompilation;scr_myscript = function()
no longer appears even if it is the format used, although it is still accepted in compilation.I didn't bother to restrict the
myroom_last
variable to 2.3, so technically it defines one additional unused variable when the script is used on older games. This will not cause performance issues.Notes
Closes #926. Closes #951.