| | 50 | |
| | 51 | === Essential Event Attributes === |
| | 52 | |
| | 53 | The following attributes affect the intepretation of a YAML document. |
| | 54 | |
| | 55 | * `ALIAS` |
| | 56 | * `anchor` - the alias anchor; `[0-9a-zA-Z_-]+`; not `NULL`. |
| | 57 | * `SCALAR` |
| | 58 | * `anchor` - the node anchor; `[0-9a-zA-Z_-]+`; may be `NULL`. |
| | 59 | * `tag` - the node tag; should either start with `!` (local tag) or be a valid URL (global tag); |
| | 60 | may be `NULL` or `!` in which case either `plain_implicit` or `quoted_implicit` should be `True`. |
| | 61 | * `plain_implicit` - `True` if the node tag may be omitted whenever the scalar value |
| | 62 | is presented in the plain style. |
| | 63 | * `quoted_implicit` - `True` if the node tag may be omitted whenever the scalar value |
| | 64 | is presented in any non-plain style. |
| | 65 | * `value` - the scalar value; a valid utf-8 sequence; `NULL` means empty. |
| | 66 | * `SEQUENCE-START` |
| | 67 | * `anchor` - the node anchor; `[0-9a-zA-Z_-]+`; may be `NULL`. |
| | 68 | * `tag` - the node tag; should either start with `!` (local tag) or be a valid URL (global tag); |
| | 69 | may be `NULL` or `!` in which case `implicit` should be `True`. |
| | 70 | * `implicit` - `True` if the node tag may be omitted. |
| | 71 | * `MAPPING-START` |
| | 72 | * `anchor` - the node anchor; `[0-9a-zA-Z_-]+`; may be `NULL`. |
| | 73 | * `tag` - the node tag; should either start with `!` (local tag) or be a valid URL (global tag); |
| | 74 | may be `NULL` or `!` in which case `implicit` should be `True`. |
| | 75 | * `implicit` - `True` if the node tag may be omitted. |
| | 76 | |
| | 77 | === Stylistic Event Attributes === |
| | 78 | |
| | 79 | The following attributes don't affect the interpretation of a YAML document. While parsing a YAML |
| | 80 | document, an application should not consider these attributes for resolving implicit tags and |
| | 81 | constructing representation graphs or native objects. The Emitter may ignore these attributes |
| | 82 | if they cannot be satisfied. |
| | 83 | |
| | 84 | * `STREAM-START` |
| | 85 | * `encoding` - the document encoding; `utf-8|utf-16-le|utf-16-be`. |
| | 86 | * `DOCUMENT-START` |
| | 87 | * `version` - the version specified with the `%YAML` directive; the only valid value is `1.1`; may be `NULL`. |
| | 88 | * `tag` - a set of tag handles and the corresponding tag prefixes specified with the `%TAG` directive; |
| | 89 | tag handles should match `!|!!|![0-9a-zA-Z_-]+!` while tag prefixes should be prefixes of valid local |
| | 90 | or global tags; may be `NULL`. |
| | 91 | * `implicit` - `True` if the document start indicator `---` is not present. |
| | 92 | * `DOCUMENT-END` |
| | 93 | * `implicit` - `True` if the document end indicator `...` is not present. |
| | 94 | * `SCALAR` |
| | 95 | * `style` - the value style; `plain|single-quoted|double-quoted|literal|folded`. |
| | 96 | * `SEQUENCE-START` |
| | 97 | * `style` - the sequence style; `block|flow`. |
| | 98 | * `MAPPING-START` |
| | 99 | * `style` - the mapping style; `block|flow`. |
| | 100 | * ''any event'' |
| | 101 | * `start_mark` - the position of the event beginning; `offset` (in bytes), `index` (in characters), |
| | 102 | `line` and `column` (starting from `0`). |
| | 103 | * `end_mark` - the position of the event end; `offset` (in bytes), `index` (in characters), |
| | 104 | `line` and `column` (starting from `0`). |