-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Toggle ability to stub undefined natives #5
Comments
What I am thinking of doing is having a class that reads all the Inc files in the include directory, and spits out properly formatted and documented @Native stubs that accept the parameters and print them. Then those can be used as a base to work from. |
Just stubbing some out so I can understand how this thing works. But, if you can help me do one archetype function from each include, and have it save some basic mapping that is usable, I can start doing the other natives. https://github.com/jaredballou/pysmx/blob/master/smx/sourcemod.py if you want to peek. |
FYI: I've revisited the native system, and brought it into py3 world. Now, instead of manually specifying Here's the list so far, with check marks for implemented ones: Natives List
|
I dumped the MySQL DB to a sqlite DB, as well: pawn-docgen.sqlite3.zip |
Well, as it turns out, pawn-docgen misses a bunch of natives (I think due to them being multi-lined), and it doesn't split the signature up by params. So, I'm just writing my own slim, purpose-built parser using Lark and regex. It's coming along well, and is converting all natives and enums over to their pysmx equivalents. I still have to write the grammar/parser/formatter for methodmaps, and implement the |
Aight, I finished up the stubgen and pushed stubs for all unimplemented natives. To run the stubgen yourself, install pysmx with its extra: pip install pysmx[stubgen] I mainly wrote it for myself, so it uses features only available in Python 3.11, meaning you'll need that, too. To run it: pysmx_stubgen path/to/output/dir/ (It currently doesn't have any terminal output, nor a cmdline option for setting the include dir — it just uses the one from pysmx.) |
Is it possible to have a "debug toggle" or something similar to attempt execution of a plugin via the runtime to warn instead of dying when hitting an undefined native? Ideally, I'd like to be able to have it spit out a list of the native calls it was not able to run, so that the plugin would attempt to continue running and show me the natives we need to implement. I understand that this would break the ability to accurately run the plugin, but I think this might be a good way to let us push through tests of the implemented functions, and produce a useful output that can be sent to us so that we can see what natives PySMX users want to see implemented.
The text was updated successfully, but these errors were encountered: