-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inject extension scopes while running the resolution algorithm (#1170)
This PR builds on top of #1149 This changes the way we handle extension scopes (ie. `using` directives) in bindings. Instead of using the scope stack from the stack graph, we hook into the resolution algorithm and inject new graph edges from nodes designated as extension hooks (usually the source unit's lexical scope) to extension scopes which are defined at each contract/library and contain the definition nodes from `using` directives. This simplifies the rules quite a bit and greatly improves performance, particularly in the case of Solidity < 0.7.0 where `using` directives are inherited from base contracts. This PR also moves built-ins parsing and ingestion to `slang_solidity` crate. Since the built-ins file needs to be pre-processed to transform the symbols as to ensure no conflicts can occur with user code, adding the built-ins requires a couple of manual steps that were replicated in every construction of Solidity bindings API. By encapsulating this functionality in the `slang_solidity` crate we remove a source of user error and make it easier to make changes to the built-ins ingestion code.
- Loading branch information
Showing
13 changed files
with
403 additions
and
342 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.