Skip to content

Some documentation fixes #15245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/Syntax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ pieces of syntax that aren't really relevant to the semantics of the program,
such as whitespace and comments. These are modeled as collections and, with the
exception of comments, are sort of "run-length" encoded. For example, a sequence
of four spaces is represented by `{ Kind: TriviaKind::Space, Count: 4 }`, not
the literal text `" "`.
the literal text `"    "`.

Some examples of the "atoms" of `Trivia`:

Expand Down Expand Up @@ -502,15 +502,15 @@ following fields:

| Key | Type | Description |
| --- | ---- | ----------- |
| `kind` | `String` | The `SyntaxKind` of this child. This must have a corresponding `Node` with that kind. |
| `kind` | `String` | The `SyntaxKind` of this child. This must have a corresponding `Node` with that kind (or corresponding `Token` in both `include/swift/Syntax/TokenKinds.def` and `SYNTAX_TOKENS`). |
| `is_optional` | `Bool?` | Whether this child is required in a fully-formed object, or if it is allowed to remain `missing`. Defaults to `false` if not present.
| `token_choices` | `[String]?` | A list of `Token`s which are considered "valid" values for `Token` children. |
| `text_choices` | `[String]?` | A list of valid textual values for tokens. If this is not provided, any textual value is accepted for tokens like `IdentifierToken`. |

#### Tokens

A `Token` represents one of the `tok::` enums in
`include/Syntax/TokenKinds.def`. `Token.py` has a top-level array of token
`include/swift/Syntax/TokenKinds.def`. `Token.py` has a top-level array of token
declarations. The `Token` class has the following fields.

| Key | Type | Description |
Expand Down