Files
carbon-lang/docs/design/lexical_conventions/README.md
T
Chandler CarruthandRichard Smith cfd1ed8484 Switch from Prettier to Rumdl for Markdown formatting (#7423)
Rumdl already appears to have _significantly_ fewer bugs than prettier,
and a solid LSP for editor integration.

The tool is: https://github.com/rvben/rumdl/

I've separated out the change across three commits for easier review.

The configuration tries to match the existing formatting, the changes to
the all the files are to correct issues found by the new tool.

Assisted-by: Antigravity with Gemini

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2026-06-26 21:42:01 +00:00

1.4 KiB

Lexical conventions

Table of contents

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:

The sequence of lexical elements is formed by repeatedly removing the longest initial sequence of characters that forms a valid lexical element, with the following exception:

  • When a numeric literal immediately follows a . or -> token, with no intervening whitespace, a real literal is never formed. Instead, the token will end no later than the next . character. For example, tuple.1.2 is five tokens, tuple . 1 . 2, not three tokens, tuple . 1.2. However, tuple . 1.2 is lexed as three tokens.