Skip to content

Start documenting name resolution. #937

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
merged 7 commits into from
Jan 21, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Updates from review.
  • Loading branch information
ehuss committed Jan 19, 2021
commit a989af055ff4fd7e1212754490fff72c3f7cc1be
14 changes: 7 additions & 7 deletions src/names.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Names

An *entity* is a language construct that can be referred to in some way within
the source program, usually via a [*path*]. Entities include [types], [items],
the source program, usually via a [path]. Entities include [types], [items],
[generic parameters], [variable bindings], [loop labels], [lifetimes],
[fields], [attributes], and [lints].

A *declaration* is a syntactical construct that can introduce a *name* to
refer to an entity. Entity names are valid within a [*scope*] — a region of
source text where that name may be referenced.

Some entities are [explicitly declared](#explicit-entities) in the source
code, and some are [implicitly declared](#implicit-entities) as part of the
language or compiler extensions.
Some entities are [explicitly declared](#explicitly-declared-entities) in the
source code, and some are [implicitly declared](#implicitly-declared-entities)
as part of the language or compiler extensions.

[*Paths*] are used to refer to an entity, possibly in another scope. Lifetimes
and loop labels use a [dedicated syntax][lifetimes-and-loop-labels] using a
Expand All @@ -25,7 +25,7 @@ and labels to entity declarations.

Access to certain names may be restricted based on their [*visibility*].

## Explicit entities
## Explicitly declared entities

Entities that explicitly introduce a name in the source code are:

Expand Down Expand Up @@ -59,7 +59,7 @@ Entities that explicitly introduce a name in the source code are:
Additionally, [macro invocations] and [attributes] can introduce names by
expanding to one of the above items.

## Implicit entities
## Implicitly declared entities

The following entities are implicitly defined by the language, or are
introduced by compiler options and extensions:
Expand All @@ -85,7 +85,6 @@ to with certain [path qualifiers] or aliases.

[*Name resolution*]: names/name-resolution.md
[*namespaces*]: names/namespaces.md
[*path*]: paths.md
[*paths*]: paths.md
[*scope*]: names/scopes.md
[*visibility*]: visibility-and-privacy.md
Expand Down Expand Up @@ -128,6 +127,7 @@ to with certain [path qualifiers] or aliases.
[macro invocations]: macros.md#macro-invocation
[matcher metavariables]: macros-by-example.md#metavariables
[Module declarations]: items/modules.md
[path]: paths.md
[path qualifiers]: paths.md#path-qualifiers
[Standard library prelude]: names/preludes.md#standard-library-prelude
[Static item declarations]: items/static-items.md
Expand Down