Files
carbon-lang/docs/design/lexical_conventions/whitespace.md
T
Jon Meow 79a9b51d07 Update pre-commits, add and address flake8 (#195)
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)
2020-11-13 16:34:23 -08:00

1.2 KiB

Whitespace

Table of contents

Overview

The exact lexical form of Carbon whitespace has not yet been settled. However, Carbon will follow lexical conventions for whitespace based on Unicode Annex #31. TODO: Update this once the precise rules are decided; see the Unicode source files proposal.

Unicode Annex #31 suggests selecting whitespace characters based on the characters with Unicode property Pattern_White_Space, which is currently these 11 characters:

  • U+0009 CHARACTER TABULATION (horizontal tab)
  • U+000A LINE FEED (traditional newline)
  • U+000B LINE TABULATION (vertical tab)
  • U+000C FORM FEED (page break)
  • U+000D CARRIAGE RETURN
  • U+0020 SPACE
  • U+0085 NEXT LINE (Unicode newline)
  • U+200E LEFT-TO-RIGHT MARK
  • U+200F RIGHT-TO-LEFT MARK
  • U+2028 LINE SEPARATOR
  • U+2029 PARAGRAPH SEPARATOR

The quantity and kind of whitespace separating tokens is ignored except where otherwise specified.