Files
carbon-lang/docs/design/lexical_conventions/words.md
T
Richard Smith aec77a6f39 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.
2021-10-06 11:05:41 -07:00

1.6 KiB

Words

Table of contents

Overview

A word is a lexical element formed from a sequence of letters or letter-like characters, such as fn or Foo or Int.

The exact lexical form of words has not yet been settled. However, Carbon will follow lexical conventions for identifiers based on Unicode Annex #31. TODO: Update this once the precise rules are decided; see the Unicode source files 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

References