Skip to content

Add 'from common_func import ...' support#3

Draft
garyttierney wants to merge 2 commits intoGrimrukh:mainfrom
garyttierney:feat/common_func-import
Draft

Add 'from common_func import ...' support#3
garyttierney wants to merge 2 commits intoGrimrukh:mainfrom
garyttierney:feat/common_func-import

Conversation

@garyttierney
Copy link
Contributor

@garyttierney garyttierney commented Apr 2, 2021

This is still a WIP so I've marked it as a draft. There's no error handling yet and the discovery of common_func is a little out of place, but it does the trick for me so far in DS3.

Still todo:

  • Importing events listed by wildcard or name in from common_func import *
  • Importing events qualified by module in import common_func
  • More robust error handling
  • Add some docstrings
  • Decompiler support

Do you think this is the right time/place to be reading custom_func.py and parsing it's AST (i.e. on demand as opposed to passing in a load_common_func=True to an EMEVD instance).

@Grimrukh
Copy link
Owner

This is looking good. Yes, I think this could be easily expanded to import event functions from any file - we'd just need to tell the compiler that only the common_func ones don't need to be inlined in the final EMEVD.

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

Successfully merging this pull request may close these issues.

2 participants