| 284 | }(Processor_1.Processor)); |
| 285 | exports.ProcessorLocal = ProcessorLocal; |
| 286 | function processLineHook(lines, runtime, offset, cb) { |
| 287 | if (offset >= lines.length) { |
| 288 | cb(); |
| 289 | } |
| 290 | else { |
| 291 | if (runtime.preFileLineHook) { |
| 292 | var line = lines[offset]; |
| 293 | var res = runtime.preFileLineHook(line, runtime.parsedLineNumber + offset); |
| 294 | offset++; |
| 295 | if (res && res.then) { |
| 296 | res.then(function (value) { |
| 297 | lines[offset - 1] = value; |
| 298 | processLineHook(lines, runtime, offset, cb); |
| 299 | }); |
| 300 | } |
| 301 | else { |
| 302 | lines[offset - 1] = res; |
| 303 | while (offset < lines.length) { |
| 304 | lines[offset] = runtime.preFileLineHook(lines[offset], runtime.parsedLineNumber + offset); |
| 305 | offset++; |
| 306 | } |
| 307 | cb(); |
| 308 | } |
| 309 | } |
| 310 | else { |
| 311 | cb(); |
| 312 | } |
| 313 | } |
| 314 | } |