Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MAJKFL
Copy link
Contributor

@MAJKFL MAJKFL commented Sep 12, 2024

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.

# 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).
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👍🏽

@MAJKFL MAJKFL requested a review from ahoppen September 17, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants