Refuses an unquoted pipe inside a list, set, or map
All 3 scenarios hold
These rules cover how one line divides into fields. They apply before the parser reads a field as a value.
Each Row below is parsed as the only data row under a one-column header. Fields shows the captured field list, printed back out. Fields is text rather than a list column because a list cannot hold a null element: writing [a, , c] is itself a parse error. A null field is what several of these rules are about.
Brackets and braces do not protect a pipe. Only quotes do.
The pipe splits the row inside the collection and leaves an unbalanced fragment. The parser therefore names the whole row, not the pipe. To keep a pipe inside a collection, quote the element: ['a | b'].
expected outcome
broken scenario
| Scenario | Row | Error message? |
|---|---|---|
| Unquoted pipe in a list | [a | b] | Failed to parse `[a | b]` in row `[a | b]` |
| Unquoted pipe in a set | {a | b} | Failed to parse `{a | b}` in row `{a | b}` |
| Unquoted pipe in a map value | [k: a | b] | Failed to parse `[k: a | b]` in row `[k: a | b]` |