-
Notifications
You must be signed in to change notification settings - Fork 410
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
[SwiftLexicalLookup] Add unqualified lookup rules documentation. #2849
base: main
Are you sure you want to change the base?
[SwiftLexicalLookup] Add unqualified lookup rules documentation. #2849
Conversation
# Unqualified Lookup Rules | ||
|
||
## Overview | ||
Unqualified lookup can be initiated from any source position, optionally targeting a specific identifier for name comparison. Unqualified lookup traverses the syntax tree from bottom-up, collecting names that match the lookup criteria. A name matches the lookup if the specified identifier (if present) refers to the introduced name and the position from which the unqualified lookup was triggered is preceded by the position where the name was introduced (if specified). |
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.
and the position from which the unqualified lookup was triggered is preceded by the position where the name was introduced (if specified)
This isn’t technically true because types can be defined after the lookup position, right?
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 tried to indicate it by having (if specified)
by the end of the sentence, but I agree it was a bit ambiguous. I revised the ending.
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.
Sounds good 👍🏽
This PR includes a documentation article describing in high level SwiftLexicalLookup name lookup rules as well as more detailed dive into each of the scopes.