( sc: Scanner, result: GenericParamDef[], ctx: BaseParseContext )
| 364 | type ParamsTerminator = WhitespaceChar | "," |
| 365 | |
| 366 | export const parseGenericParamName = ( |
| 367 | sc: Scanner, |
| 368 | result: GenericParamDef[], |
| 369 | ctx: BaseParseContext |
| 370 | ): GenericParamDef[] => { |
| 371 | sc.skipSpace() |
| 372 | const name = shiftUntilTerminator(sc) |
| 373 | if (name === "") { |
| 374 | // if we've reached the end of the string and have parsed at least one |
| 375 | // param, return the valid result |
| 376 | if (sc.peek === "" && result.length) return result |
| 377 | return throwParseError(emptyGenericParameterMessage) |
| 378 | } |
| 379 | |
| 380 | sc.skipSpace() |
| 381 | |
| 382 | return _parseOptionalConstraint(sc, name, result, ctx) |
| 383 | } |
| 384 | |
| 385 | type parseName< |
| 386 | unscanned extends string, |
no test coverage detected