-
Notifications
You must be signed in to change notification settings - Fork 564
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
Export FScanner parser to ZScript as ScriptScanner #2290
Conversation
507540b
to
fc36ff6
Compare
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.
Please rewrite this to not use multiple inheritance. A lot of ZScripts inner workings circumvent standard C++ logic that ensure type safety and this may easily end up trashing the pointer to such an object because it may not point to where you expect it anymore.
fc36ff6
to
010e68d
Compare
Done as requested. |
Please also provide a working example mod that showcases the usage of this feature. |
scriptparserexample.zip Here's one. Compile and run this PR with the ZIP file and the uploaded Since this example uses MustGetStringName function, it will abort to the console with the second one. |
I merged this manually and changed it to use direct native calls for most functions |
This PR exposes the internal
FScanner
parser to ZScript asScriptScanner
.ScriptScanner
s are created withCreate
functions, and destroyed by callingDestroy
(after which it must not be used).SetPrependMessage
is used to set the message that will be prepended to the displayed error messages in case of failure. The rest of the exported functions work unchanged from their native counterparts.