More cleanup and a possible fix for #29

This commit is contained in:
dcodeIO
2018-02-16 11:55:13 +01:00
parent f729444320
commit 3d7e8b2b7a
17 changed files with 1038 additions and 680 deletions

View File

@ -239,14 +239,7 @@ export class Parser extends DiagnosticEmitter {
/** Obtains the next file to parse. */
nextFile(): string | null {
if (this.backlog.length) {
var filename = this.backlog[0];
for (var i = 0, k = this.backlog.length - 1; i < k; ++i)
this.backlog[i] = this.backlog[i + 1];
this.backlog.length--;
return filename;
}
return null;
return this.backlog.length ? this.backlog.shift() : null;
}
/** Finishes parsing and returns the program. */