(input: string)
| 628 | * ``` |
| 629 | */ |
| 630 | export function parseDictionary(input: string): Dictionary { |
| 631 | const state: ParserState = { input, pos: 0 }; |
| 632 | skipSP(state); |
| 633 | const dict = parseDictionaryInternal(state); |
| 634 | skipSP(state); |
| 635 | if (!isEof(state)) { |
| 636 | throw new SyntaxError( |
| 637 | `Invalid structured field: unexpected character at position ${state.pos}`, |
| 638 | ); |
| 639 | } |
| 640 | return dict; |
| 641 | } |
| 642 | |
| 643 | function parseDictionaryInternal(state: ParserState): Dictionary { |
| 644 | const dict: Map<string, Item | InnerList> = new Map(); |
no test coverage detected