You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -427,9 +427,9 @@ Decoding of value tokens follows §4 (unquoted type inference, quoted strings, n
427
427
### 9.1 Primitive Arrays (Inline)
428
428
429
429
- Encoding:
430
-
- Non-empty arrays: key[N<delim?>]: v1<delim>v2<delim>… where each vi is encoded as a primitive (Section 7) with delimiter-aware quoting.
431
-
- Empty arrays: key[0<delim?>]: (no values following).
432
-
- Root arrays: [N<delim?>]: v1<delim>…
430
+
- Non-empty arrays: `key[N<delim?>]: v1<delim>v2<delim>…` where each vi is encoded as a primitive (Section 7) with delimiter-aware quoting.
431
+
- Empty arrays: `key[0<delim?>]:` (no values following).
432
+
- Root arrays: `[N<delim?>]: v1<delim>…`
433
433
- Decoding:
434
434
- Split using the active delimiter declared by the header; non-active delimiters MUST NOT split values.
435
435
- When splitting inline arrays, empty tokens (including those surrounded by whitespace) decode to the empty string.
@@ -438,12 +438,12 @@ Decoding of value tokens follows §4 (unquoted type inference, quoted strings, n
438
438
### 9.2 Arrays of Arrays (Primitives Only) — Expanded List
439
439
440
440
- Encoding:
441
-
- Parent header: key[N<delim?>]: on its own line.
441
+
- Parent header: `key[N<delim?>]:` on its own line.
442
442
- Each inner primitive array is a list item:
443
-
- - [M<delim?>]: v1<delim>v2<delim>…
444
-
- Empty inner arrays: - [0<delim?>]:
443
+
- `- [M<delim?>]: v1<delim>v2<delim>…`
444
+
- Empty inner arrays: `- [0<delim?>]:`
445
445
- Decoding:
446
-
- Items appear at depth +1, each starting with "- " and an inner array header "[M<delim?>]: …".
446
+
- Items appear at depth +1, each starting with "- " and an inner array header `[M<delim?>]: …`.
447
447
- Inner arrays are split using their own active delimiter; in strict mode, counts MUST match M.
448
448
- In strict mode, the number of list items MUST equal outer N.
449
449
@@ -455,10 +455,10 @@ Tabular detection (encoding; MUST hold for all elements):
455
455
- All values across these keys are primitives (no nested arrays/objects).
456
456
457
457
When satisfied (encoding):
458
-
- Header: key[N<delim?>]{f1<delim>f2<delim>…}: where field order is the first object's key encounter order.
458
+
- Header: `key[N<delim?>]{f1<delim>f2<delim>…}:` where field order is the first object's key encounter order.
459
459
- Field names encoded per Section 7.3.
460
460
- Rows: one line per object at depth +1 under the header; values are encoded primitives (Section 7) and joined by the active delimiter.
461
-
- Root tabular arrays omit the key: [N<delim?>]{…}: followed by rows.
461
+
- Root tabular arrays omit the key: `[N<delim?>]{…}:` followed by rows.
462
462
463
463
Decoding:
464
464
- A tabular header declares the active delimiter and ordered field list.
@@ -478,19 +478,19 @@ Decoding:
478
478
### 9.4 Mixed / Non-Uniform Arrays — Expanded List
479
479
480
480
When tabular requirements are not met (encoding):
481
-
- Header: key[N<delim?>]:
481
+
- Header: `key[N<delim?>]:`
482
482
- Each element is rendered as a list item at depth +1 under the header:
483
-
- Primitive: - <primitive>
484
-
- Primitive array: - [M<delim?>]: v1<delim>…
483
+
- Primitive: `- <primitive>`
484
+
- Primitive array: `- [M<delim?>]: v1<delim>…`
485
485
- Object: formatted per Section 10 (objects as list items).
486
-
- Complex arrays: - key'[M<delim?>]: followed by nested items as appropriate.
486
+
- Complex arrays: `- key'[M<delim?>]:` followed by nested items as appropriate.
487
487
488
488
Decoding:
489
489
- Header declares list length N and the active delimiter for any nested inline arrays.
490
490
- Each list item starts with "- " at depth +1 and is parsed as:
491
491
- Primitive (no colon and no array header),
492
-
- Inline primitive array (- [M<delim?>]: …),
493
-
- Object with first field on the hyphen line (- key: … or - key[N…]{…}: …),
492
+
- Inline primitive array (`- [M<delim?>]: …`),
493
+
- Object with first field on the hyphen line (`- key: …` or `- key[N…]{…}: …`),
494
494
- Or nested arrays via nested headers.
495
495
- In strict mode, the number of list items MUST equal N.
496
496
@@ -501,13 +501,13 @@ For an object appearing as a list item:
501
501
- Empty object list item: a single "-" at the list-item indentation level.
502
502
- Encoding (normative):
503
503
- When a list-item object has a tabular array (Section 9.3) as its first field in encounter order, encoders MUST emit the tabular header on the hyphen line:
504
-
- The hyphen and tabular header appear on the same line at the list-item depth: - key[N<delim?>]{fields}:
504
+
- The hyphen and tabular header appear on the same line at the list-item depth: `- key[N<delim?>]{fields}:`
505
505
- Tabular rows MUST appear at depth +2 (relative to the hyphen line).
506
506
- All other fields of the same object MUST appear at depth +1 under the hyphen line, in encounter order, using normal object field rules (Section 8).
507
507
- Encoders MUST NOT emit tabular rows at depth +1 or sibling fields at the same depth as rows when the first field is a tabular array.
508
508
- For all other cases (first field is not a tabular array), encoders SHOULD place the first field on the hyphen line. A bare hyphen on its own line is used only for empty list-item objects.
509
509
- Decoding (normative):
510
-
- When a decoder encounters a list-item line of the form - key[N<delim?>]{fields}: at depth d, it MUST treat this as the start of a tabular array field named key in the list-item object.
510
+
- When a decoder encounters a list-item line of the form `- key[N<delim?>]{fields}:` at depth d, it MUST treat this as the start of a tabular array field named key in the list-item object.
511
511
- Lines at depth d+2 that conform to tabular row syntax (Section 9.3) are rows of that tabular array.
512
512
- Lines at depth d+1 are additional fields of the same list-item object; the presence of a line at depth d+1 after rows terminates the rows.
513
513
- All other object-as-list-item patterns (bare hyphen, first field on hyphen line for non-tabular values) are decoded according to the general rules in Section 8 and Section 9.
@@ -516,7 +516,7 @@ For an object appearing as a list item:
516
516
517
517
- Supported delimiters:
518
518
- Comma (default): header omits the delimiter symbol.
519
-
- Tab: header includes HTAB inside brackets and braces (e.g., [N<TAB>], {a<TAB>b}); rows/inline arrays use tabs.
519
+
- Tab: header includes HTAB inside brackets and braces (e.g., `[N<TAB>]`, `{a<TAB>b}`); rows/inline arrays use tabs.
520
520
- Pipe: header includes "|" inside brackets and braces; rows/inline arrays use "|".
521
521
522
522
### 11.1 Encoding Rules (Normative for Encoders)
@@ -1396,9 +1396,9 @@ Non-Serializable Types:
1396
1396
1397
1397
Implementations in any language SHOULD:
1398
1398
1. Document their normalization policy clearly, especially for:
1399
-
- Large or arbitrary-precision numbers (lossless string vs. approximate number)
1400
-
- Date/time representations (ISO 8601 format details)
1401
-
- Collection type mappings (order preservation for sets)
1399
+
- Large or arbitrary-precision numbers (lossless string vs. approximate number)
1400
+
- Date/time representations (ISO 8601 format details)
1401
+
- Collection type mappings (order preservation for sets)
1402
1402
2. Provide configuration options where multiple strategies are reasonable (e.g., lossless vs. approximate numeric encoding).
1403
1403
3. Ensure that normalization is deterministic: encoding the same host value twice MUST produce identical TOON output.
0 commit comments