Total Complexity | 4 |
Complexity/F | 4 |
Lines of Code | 15 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
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 | while (true) { |
||
25 | x = findCode(txt, posn) |
||
26 | if (x.start === -1 || x.commandString.indexOf('mdpInsert ') !== -1) { |
||
27 | return x |
||
28 | } else { |
||
29 | posn = x.start + x.length |
||
30 | } |
||
31 | } |
||
|
|||
32 | } |
||
33 |