-
Notifications
You must be signed in to change notification settings - Fork 21
Fix multiple imports #57
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
base: master
Are you sure you want to change the base?
Conversation
Enhance JSONDepGraphGenerator to sort the nodes and links. Test JSONDepGraphGenerator.
Extend test of HardcoreSyntax to import from two new embedded modules ImportModule1 and ImportModule2, and check the IMPORTS support that is working.
Add test that imports the same name from multiple modules, with an expected failure. This is permitted by ITU-T X.680, but compile_text() doesn't support this.
ASN.1 supports importing the same name from different modules as well as allowing that name to be in the current module - refer to ITU-T X.680 and https://stackoverflow.com/a/67910959. Rework the IMPORTS tracking in _imp_ from dict name -> module dict name -> list(module, ...), and resolve types that way. Fixes pycrate-org#56
|
Thanks for this PR: this looks like an ambitious one. I tested the changes against the entire set of ASN.1 specs, but the JSON code generator now breaks on module I will need to investigate your changes further to understand the root cause of the issue. If you want to solve this on your side, here are the steps I'd follow when touching the ASN.1 compiler:
You can otherwise set the globals |
The JSON nodes and links are now sorted by JSONDepGraphGenerator (see commit 1939a8e), so regenerate the .json files.
Test import of a type (ImportModule1.Imp1Str) that itself is imported from another module (ImportModule2.Imp2Str)
|
Apologies for not running I've updated the branch and made the following improvements:
I can now successfully run all the tests on the branch: |
|
@mitshell : if it's easier, I can break up this PR into two new PRs to make it easier to review the parts separately:
Thoughts? |
|
No worries, I'll take some time to review this PR as is: I don't have much time right now and I'll do my best. Thanks anyway for this PR, which loolks pretty nice. |
asn1c: fix IMPORTS of same name from multiple modules
ASN.1 supports importing the same name from different modules as well as allowing that name to be in the current module - refer to ITU-T X.680 and https://stackoverflow.com/a/67910959.
Rework the IMPORTS tracking in imp from dict name -> module dict name -> list(module, ...), and resolve types that way.
Fixes #56