MCPcopy Create free account
hub / github.com/cst/cst / parseAndGetStatementInLoop

Function parseAndGetStatementInLoop

test/utils.js:72–81  ·  view source on GitHub ↗
(code: string, loopLabel: string)

Source from the content-addressed store, hash-verified

70}
71
72export function parseAndGetStatementInLoop(code: string, loopLabel: string): Object {
73 let parser = new Parser();
74 if (loopLabel) {
75 let program = parser.parse(`${loopLabel}: while(true){${code}}`);
76 return program.body[0].body.body.body[0];
77 } else {
78 let program = parser.parse(`while(true){${code}}`);
79 return program.body[0].body.body[0];
80 }
81}
82
83export function parseAndGetStatementInFunction(code: string): Object {
84 let parser = new Parser();

Callers 2

BreakStatement.jsFile · 0.90

Calls 1

parseMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…