mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Updates the documentation under `docs/design/` to use `ref` instead of `addr` after their removal in #5434. Care was taken to manually clean up edge cases and, in a couple cases, surrounding text (see 3d72c49bb75c0f40ca7e8114b6a1369b941e1697). After this change, there are no matches for `addr(?!ess)` in `docs/design/`. Closes #6032
Lexical conventions
Table of contents
Lexical elements
The first stage of processing a source file is the division of the source file into lexical elements.
A lexical element is one of the following:
-
a maximal sequence of whitespace characters
-
a word
-
a literal:
-
a comment
The sequence of lexical elements is formed by repeatedly removing the longest initial sequence of characters that forms a valid lexical element, with the following exception:
- When a numeric literal immediately follows a
.or->token, with no intervening whitespace, a real literal is never formed. Instead, the token will end no later than the next.character. For example,tuple.1.2is five tokens,tuple.1.2, not three tokens,tuple.1.2. However,tuple . 1.2is lexed as three tokens.