(state: ParserState)
| 1095 | } |
| 1096 | |
| 1097 | function parseKey(state: ParserState): string { |
| 1098 | if (!isKeyStart(peek(state))) { |
| 1099 | throw new SyntaxError( |
| 1100 | `Invalid structured field: invalid key start at position ${state.pos}`, |
| 1101 | ); |
| 1102 | } |
| 1103 | |
| 1104 | const startPos = state.pos; |
| 1105 | state.pos++; // Skip validated first char |
| 1106 | while (!isEof(state) && isKeyChar(peek(state))) { |
| 1107 | state.pos++; |
| 1108 | } |
| 1109 | |
| 1110 | return state.input.slice(startPos, state.pos); |
| 1111 | } |
| 1112 | |
| 1113 | function parseParameters(state: ParserState): Parameters { |
| 1114 | const parameters: Map<string, BareItem> = new Map(); |
no test coverage detected