Просмотр исходного кода

Add a keyword list. (#869)

This list was extracted from currently-approved proposals and
corresponding design documents. This is intended to be a summary of the
status quo, not a change.
Richard Smith 4 лет назад
Родитель
Сommit
aec77a6f39
1 измененных файлов с 45 добавлено и 0 удалено
  1. 45 0
      docs/design/lexical_conventions/words.md

+ 45 - 0
docs/design/lexical_conventions/words.md

@@ -11,6 +11,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 ## Table of contents
 
 -   [Overview](#overview)
+-   [Keywords](#keywords)
 -   [Alternatives considered](#alternatives-considered)
 -   [References](#references)
 
@@ -27,6 +28,50 @@ follow lexical conventions for identifiers based on
 the precise rules are decided; see the
 [Unicode source files](/proposals/p0142.md#characters-in-identifiers) proposal.
 
+## Keywords
+
+The following words are interpreted as keywords:
+
+-   `abstract`
+-   `addr`
+-   `alias`
+-   `and`
+-   `api`
+-   `auto`
+-   `base`
+-   `break`
+-   `case`
+-   `class`
+-   `continue`
+-   `default`
+-   `else`
+-   `extends`
+-   `external`
+-   `fn`
+-   `for`
+-   `friend`
+-   `if`
+-   `impl`
+-   `import`
+-   `interface`
+-   `let`
+-   `library`
+-   `match`
+-   `namespace`
+-   `not`
+-   `or`
+-   `override`
+-   `package`
+-   `partial`
+-   `private`
+-   `protected`
+-   `return`
+-   `returned`
+-   `var`
+-   `virtual`
+-   `where`
+-   `while`
+
 ## Alternatives considered
 
 -   [Character encoding: We could restrict words to ASCII.](/proposals/p0142.md#character-encoding-1)