MCPcopy Index your code
hub / github.com/JavaScriptRegenerated/yieldparser / FunctionParser

Function FunctionParser

src/modules.test.ts:110–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108 }
109
110 function* FunctionParser() {
111 yield 'function';
112 yield whitespaceMay;
113 const isGenerator: boolean = yield has('*');
114 yield whitespaceMay;
115 const { name }: { name: string } = yield Identifier;
116 yield whitespaceMay;
117 yield '(';
118 yield ')';
119 yield whitespaceMay;
120 yield '{';
121 yield whitespaceMay;
122 let statements: Array<unknown> = [];
123 while ((yield has('}')) === false) {
124 yield whitespaceMay;
125 const statement = yield [
126 ConstStatement,
127 ReturnStatement,
128 YieldStatement,
129 FunctionParser,
130 ];
131 statements.push(statement);
132 yield whitespaceMay;
133 }
134 // yield '}';
135 return { type: 'function', name, isGenerator, statements };
136 }
137
138 function* ImportStatement() {
139 yield 'import';

Callers

nothing calls this directly

Calls 1

hasFunction · 0.90

Tested by

no test coverage detected