Skip to content

[SwiftLexicalLookup] Add unqualified lookup rules documentation. #2849

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

Merged

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
@MAJKFL
Copy link
Contributor Author

MAJKFL commented Oct 7, 2024

@swift-ci please test

@MAJKFL
Copy link
Contributor Author

MAJKFL commented Oct 7, 2024

@swift-ci please test windows

@MAJKFL
Copy link
Contributor Author

MAJKFL commented Oct 7, 2024

@swift-ci please test Linux

@MAJKFL
Copy link
Contributor Author

MAJKFL commented Oct 7, 2024

@swift-ci please test Windows

@MAJKFL
Copy link
Contributor Author

MAJKFL commented Oct 7, 2024

@swift-ci Please test Windows platform

@ahoppen
Copy link
Member

ahoppen commented Oct 8, 2024

@swift-ci Please test Windows

@MAJKFL MAJKFL merged commit c00cc6a into swiftlang:main Oct 8, 2024
3 checks passed
@MAJKFL MAJKFL deleted the unqualified-lookup-rules-documentation branch October 16, 2024 11:24
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