(input: string)
| 702 | * ``` |
| 703 | */ |
| 704 | export function parseItem(input: string): Item { |
| 705 | const state: ParserState = { input, pos: 0 }; |
| 706 | skipSP(state); |
| 707 | const item = parseItemInternal(state); |
| 708 | skipSP(state); |
| 709 | if (!isEof(state)) { |
| 710 | throw new SyntaxError( |
| 711 | `Invalid structured field: unexpected character at position ${state.pos}`, |
| 712 | ); |
| 713 | } |
| 714 | return item; |
| 715 | } |
| 716 | |
| 717 | function parseItemOrInnerList(state: ParserState): Item | InnerList { |
| 718 | if (peek(state) === "(") { |
no test coverage detected