mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 19:22:38 +00:00
Update syntax of `class` and `interface` definitions to be more consistent. Constructs that add names to the class or interface from another definition are always prefixed by the `extend` keyword. Implements the decisions in: - [#995: Generics external impl versus extends](https://github.com/carbon-language/carbon-lang/issues/995), - [#1159: adaptor versus adapter may be harder to spell than we'd like](https://github.com/carbon-language/carbon-lang/issues/1159), - [#2580: How should Carbon handle conditionally implemented internal interfaces](https://github.com/carbon-language/carbon-lang/issues/2580), and - [#2770: Terminology for internal and external implementations](https://github.com/carbon-language/carbon-lang/issues/2770). Co-authored-by: Richard Smith <richard@metafoo.co.uk>
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.