Total Complexity | 4 |
Complexity/F | 4 |
Lines of Code | 15 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | /** findMdpInsert and findCode functions use a similar layout to return the location and contents |
||
18 | const {findCode} = require('./findCode.js') |
||
19 | |||
20 | export function findMdpCode (txt, start) { |
||
21 | // finds the next location of mdpInsert in a code span within txt |
||
22 | let posn = start |
||
23 | let x |
||
24 | do { |
||
25 | x = findCode(txt, posn) |
||
26 | if (x.start === -1 || x.commandString.indexOf('mdpInsert ') !== -1) { |
||
27 | break |
||
28 | } |
||
29 | posn = x.start + x.length |
||
30 | } while (true) |
||
31 | return x |
||
32 | } |
||
33 |