luatraverse.lua

changeset 4
a4f608729bbf
parent 3
842f3003db2a
child 5
b6d77a6cf45b
--- a/luatraverse.lua	Mon Oct 26 02:34:45 2009 +0000
+++ b/luatraverse.lua	Mon Oct 26 02:36:10 2009 +0000
@@ -74,6 +74,7 @@
 	-- inserts the local variables
 	-- interates over the function on the stack, starting from the one that
 	-- called traverse
+	
 	for i=2, math.huge do
 		local info = debug.getinfo(i, "f") 
 		if not info then break end 
@@ -86,8 +87,8 @@
 		end
 	end
 	
- 	while not List.isempty(env.list) do	 		
- 	
+	while not List.isempty(env.list) do	 		
+	
 		local obj = List.pop(env.list)
 		local t = type(obj)
 		traverse["traverse" .. t](env, obj)
@@ -103,7 +104,7 @@
 	
 	for key, value in pairs(obj) do	
 		edge(env, obj, key, "iskey", nil)
-		edge(env, obj, value, "key", key)		
+		edge(env, obj, value, "key", key)
 	end
 	
 	local mtable = debug.getmetatable(obj)
@@ -172,7 +173,7 @@
 
 
 -- 'how' is a string that identifies the content of 'to' and 'value':
--- 		if 'how' is "iskey", then 'to' é is a key and 'value' is nil.
+-- 		if 'how' is "iskey", then 'to' é is a key and 'value' is nil.
 -- 		if 'how' is "key", then 'to' is an object and 'value' is the name of the
 --		key.
 function edge(env, from, to, how, value)
@@ -190,5 +191,6 @@
 		if f then f(from, to, how, value) end
 		
 	end	
-	
-end
\ No newline at end of file
+end
+
+return _M;

mercurial