mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-28 22:02:37 +01:00
Adopts new copyright and markdown toc checks. The new toc check generates the toc header, so that's why all the md files changed (this had felt better to me for the long-term, more auto-generated content)
1.3 KiB
1.3 KiB
Lexical conventions
Table of contents
TODO
This is a skeletal design, added to support the overview. It should not be treated as accepted by the core team; rather, it is a placeholder until we have more time to examine this detail. Please feel welcome to rewrite and update as appropriate.
See PR 17 for context -- that proposal may replace this.
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 numeric literal
- TODO: string literals
- TODO: operators, comments, ...
The sequence of lexical elements is formed by repeatedly removing the longest initial sequence of characters that forms a valid lexical element.