Merge branch 'mplamann' into run_vm

Conflicts:
	public/vm/index.js
This commit is contained in:
2015-04-13 23:15:38 -04:00
52 changed files with 1262 additions and 32 deletions

View File

@@ -77,10 +77,11 @@ var Bc0File = function (filename) {
for (var i = 0; i < this.string_count; i++) {
var c = stream.get_u1();
if (c == 0) {
this.string_pool.push(current_string);
current_string = "";
// this.string_pool.push(current_string);
// current_string = "";
this.string_pool.push(0);
} else {
current_string += String.fromCharCode(c);
this.string_pool.push(String.fromCharCode(c));
}
}
@@ -98,6 +99,15 @@ var Bc0File = function (filename) {
}
}
Bc0File.prototype.string_from_index = function (i) {
var result = "";
while (this.string_pool[i] !== 0 && i < this.string_pool.length) {
result += this.string_pool[i];
i++;
}
return result;
}
function parse(filename) {
return new Bc0File(filename);
}