()
| 187 | }; |
| 188 | |
| 189 | const parseCString = () => { |
| 190 | if (output[0] !== '"') { |
| 191 | return ''; |
| 192 | } |
| 193 | let stringEnd = 1; |
| 194 | let inString = true; |
| 195 | let remaining = output.substr(1); |
| 196 | let escaped = false; |
| 197 | while (inString) { |
| 198 | if (escaped) { |
| 199 | escaped = false; |
| 200 | } |
| 201 | else if (remaining[0] === '\\') { |
| 202 | escaped = true; |
| 203 | } |
| 204 | else if (remaining[0] === '"') { |
| 205 | inString = false; |
| 206 | } |
| 207 | |
| 208 | remaining = remaining.substr(1); |
| 209 | stringEnd++; |
| 210 | } |
| 211 | let str; |
| 212 | try { |
| 213 | str = parseString(output.substr(0, stringEnd)); |
| 214 | } |
| 215 | catch (e) { |
| 216 | str = output.substr(0, stringEnd); |
| 217 | } |
| 218 | output = output.substr(stringEnd); |
| 219 | return str; |
| 220 | }; |
| 221 | |
| 222 | let parseValue; |
| 223 | let parseCommaResult; |
no test coverage detected