Add external symbol resolution infrastructure#1151
Merged
Conversation
10f5e49 to
8475c57
Compare
This was referenced Apr 14, 2026
DavisVaughan
approved these changes
Apr 17, 2026
|
|
||
| /// Walk the scope chain front-to-back, returning the first match. | ||
| pub fn resolve_external_name( | ||
| library: &Library, |
Contributor
There was a problem hiding this comment.
I have some weird gut feeling about library being an external input to the system
Like it feels like BindingSource::PackageExports should already have all the info it needs to resolve the symbol name
I don't feel strongly enough to request a change, just pointing out something that smells kinda maybe off
Contributor
Author
There was a problem hiding this comment.
yep how we handle library is definitely up in the air
Comment on lines
+141
to
+147
| fn test_resolve_first_match_wins() { | ||
| let library = test_library(vec![("stats", vec!["filter"])]); | ||
|
|
||
| let scope = vec![ | ||
| file_exports("utils.R", vec![("filter", range(0, 6))]), | ||
| BindingSource::PackageExports("stats".to_string()), | ||
| ]; |
Contributor
There was a problem hiding this comment.
Maybe also a test for two packages that have bindings that shadow each other?
I think that last package wins in that case?
3f6a202 to
ddad93d
Compare
8475c57 to
bec6eda
Compare
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branched from #1150
Part of #1148
library()andrequire()calls and creates scope chains from them.For future work:
aaa.Rwill have a larger chain thanzzz.R).library()calls), potentially concatenated to the global scope chain.