Skip to content

Latest commit

 

History

History
107 lines (90 loc) · 2.11 KB

File metadata and controls

107 lines (90 loc) · 2.11 KB

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.

Carbon source files, including comments and string literals, are required to be in Unicode Normalization Form C (NFC).

Keywords

The following words are interpreted as keywords:

  • abstract
  • adapt
  • addr
  • alias
  • and
  • as
  • auto
  • base
  • break
  • case
  • choice
  • class
  • constraint
  • continue
  • default
  • destructor
  • else
  • extend
  • final
  • fn
  • for
  • forall
  • friend
  • if
  • impl
  • impls
  • import
  • in
  • interface
  • let
  • library
  • like
  • match
  • namespace
  • not
  • observe
  • or
  • override
  • package
  • partial
  • private
  • protected
  • require
  • return
  • returned
  • Self
  • template
  • then
  • type
  • var
  • virtual
  • where
  • while

Alternatives considered

References