lvm.js

changeset 13
f259da6951e8
parent 12
7d748aba47ab
child 14
21a2fce50931
--- a/lvm.js	Tue Apr 06 19:27:28 2010 +0100
+++ b/lvm.js	Wed Apr 07 02:46:56 2010 +0100
@@ -56,10 +56,10 @@
 	return new LValue("function", func);
 }
 
-function LBinaryChunk(chunk)
+function LBinaryChunk(chunk, start)
 {
 	this.chunk = chunk;
-	this.pos = 12;
+	this.pos = start||12;
 	
 	this.sourceName = this.readString();
 	this.lineDefined = this.readInt();
@@ -113,6 +113,38 @@
 		}
 	}
 	
+	this.prototypes = [];
+	
+	this.numPrototypes = this.readInt();
+	for(var i=0;i<this.numPrototypes;i++)
+	{
+		var p = new LBinaryChunk(chunk, this.pos);
+		this.pos = p.pos;
+		this.prototypes.push(p);
+	}
+	
+	this.sourceLines = [];
+	
+	this.numSourceLines = this.readInt();
+	for(var i=0;i<this.numSourceLines;i++)
+	{
+		this.sourceLines.push(this.readInt());
+	}
+	
+	this.localList = [];
+	this.numLocalList = this.readInt();
+	for(var i=0;i<this.numLocalList;i++)
+	{
+		this.localList.push([this.readString(),this.readInt(),this.readInt()]);
+	}
+	
+	this.upvalueList = [];
+	this.numUpvalueList = this.readInt();
+	for(var i=0;i<this.numUpvalueList;i++)
+	{
+		this.upvalueList.push(this.readString());
+	}
+	
 	return this;
 }
 

mercurial