( sc: Scanner, name: string, result: GenericParamDef[], ctx: BaseParseContext )
| 411 | type extendsToken = typeof extendsToken |
| 412 | |
| 413 | const _parseOptionalConstraint = ( |
| 414 | sc: Scanner, |
| 415 | name: string, |
| 416 | result: GenericParamDef[], |
| 417 | ctx: BaseParseContext |
| 418 | ): GenericParamDef[] => { |
| 419 | sc.skipSpace() |
| 420 | if (sc.unscanned.startsWith(extendsToken)) sc.jumpForward(extendsToken.length) |
| 421 | else { |
| 422 | // if we don't have a contraining token here, return now so we can |
| 423 | // assume in the rest of the function body we do have a constraint |
| 424 | if (sc.peek === ",") sc.shift() |
| 425 | result.push(name) |
| 426 | return parseGenericParamName(sc, result, ctx) |
| 427 | } |
| 428 | |
| 429 | const s = parseUntilFinalizer(new RuntimeState(sc, ctx)) |
| 430 | result.push([name, s.root]) |
| 431 | |
| 432 | return parseGenericParamName(sc, result, ctx) |
| 433 | } |
| 434 | |
| 435 | type _parseOptionalConstraint< |
| 436 | unscanned extends string, |
no test coverage detected