MCPcopy Create free account
hub / github.com/aiscript-dev/aiscript / parseTypeParams

Function parseTypeParams

src/parser/syntaxes/types.ts:24–46  ·  view source on GitHub ↗
(s: ITokenStream)

Source from the content-addressed store, hash-verified

22 * ```
23*/
24export function parseTypeParams(s: ITokenStream): TypeParam[] {
25 s.expect(TokenKind.Lt);
26 s.next();
27
28 if (s.is(TokenKind.NewLine)) {
29 s.next();
30 }
31
32 const items: TypeParam[] = [parseTypeParam(s)];
33
34 while (parseOptionalSeparator(s)) {
35 if (s.is(TokenKind.Gt)) {
36 break;
37 }
38 const item = parseTypeParam(s);
39 items.push(item);
40 }
41
42 s.expect(TokenKind.Gt);
43 s.next();
44
45 return items;
46}
47
48/**
49 * ```abnf

Callers 3

parseFnDefFunction · 0.85
parseFnExprFunction · 0.85
parseFnTypeFunction · 0.85

Calls 5

parseTypeParamFunction · 0.85
parseOptionalSeparatorFunction · 0.85
expectMethod · 0.65
nextMethod · 0.65
isMethod · 0.65

Tested by

no test coverage detected