Files
carbon-lang/docs/spec/lang/lex.md
T
Richard Smith 48d5b18026 Initial rough framework for specification. (#140)
Provide an initial rough structure for the specification so we can add things
as they are decided.

Split the specification into a language and a library section. In the language
section, use one file per broad area of functionality. Divide the language up
based on the intended layering of the language design.
2022-03-16 15:43:09 -07:00

892 B

Lexical analysis

TODO

Lexical elements

  1. The sequence of Unicode code points in a source file is partitioned into contiguous subsequences called lexical elements. Formation of lexical elements begins with the first code point in the source file and proceeds in code point order.

  2. At each step, the longest valid lexical element that can be formed from a prefix of the remaining code points is formed, even if this would result in a failure to form a later lexical element. Repeating this process shall convert the entire source file into lexical elements.

  3. Valid lexical elements are:

    TODO: Add a list of lexical elements once we've decided on them.