-
Notifications
You must be signed in to change notification settings - Fork 23
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
Cleanup import resolution logic #93
Conversation
Codecov Report
@@ Coverage Diff @@
## master #93 +/- ##
==========================================
- Coverage 92.26% 92.20% -0.06%
==========================================
Files 254 254
Lines 5195 5197 +2
Branches 817 819 +2
==========================================
- Hits 4793 4792 -1
- Misses 253 254 +1
- Partials 149 151 +2
Continue to review full report at Codecov.
|
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 approve. One small question, that is not a blocker and not affect approach overall.
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.
Looks good
As of #87 we changed solc-typed-ast to infer the set of all imported files, and pass them in to the compiler in the standard JSON. The idea was that we could support a uniform interface between wasm and native compilers - since one of them (wasm) has support for resolving callbacks, but the native one doesn't. Also this way compilers don't need to look around the file system or do anything else - we give them everything they need to compile.
The logic of finding all of the imports however is a little more complex as described here. Our (ok, ok my) original code was a little hacky. In this PR we clean it up to follow more precisely the algorithm described in the docs.
Specifically:
files
computed infindAllFiles
are now proper source unit names as defined in docs.findAllFiles
was cleaned up a little ,and now no-longer returns a new map.