(code: string, loopLabel: string)
| 70 | } |
| 71 | |
| 72 | export 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 | |
| 83 | export function parseAndGetStatementInFunction(code: string): Object { |
| 84 | let parser = new Parser(); |
no test coverage detected
searching dependent graphs…