Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/tree.lua')
-rw-r--r--src/base/tree.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/base/tree.lua b/src/base/tree.lua
index 73c85af..d4947f8 100644
--- a/src/base/tree.lua
+++ b/src/base/tree.lua
@@ -43,7 +43,7 @@
if p == "." then
return tr
end
-
+
-- Look for the immediate parent for this new node, creating it if necessary.
-- Recurses to create as much of the tree as necessary.
local parentnode = tree.add(tr, path.getdirectory(p), onaddfunc)
@@ -53,7 +53,7 @@
if childname == ".." then
return parentnode
end
-
+
-- Create the child if necessary. If two children with the same name appear
-- at the same level, make sure they have the same path to prevent conflicts
-- i.e. ../Common and ../../Common can both appear at the top of the tree
@@ -66,7 +66,7 @@
onaddfunc(childnode)
end
end
-
+
return childnode
end
@@ -176,32 +176,32 @@
-- process an individual node
donode = function(node, fn, depth)
- if node.isremoved then
- return
+ if node.isremoved then
+ return
end
- if fn.onnode then
- fn.onnode(node, depth)
+ if fn.onnode then
+ fn.onnode(node, depth)
end
-
+
if #node.children > 0 then
if fn.onbranchenter then
fn.onbranchenter(node, depth)
end
- if fn.onbranch then
- fn.onbranch(node, depth)
+ if fn.onbranch then
+ fn.onbranch(node, depth)
end
dochildren(node, fn, depth + 1)
if fn.onbranchexit then
fn.onbranchexit(node, depth)
end
else
- if fn.onleaf then
- fn.onleaf(node, depth)
+ if fn.onleaf then
+ fn.onleaf(node, depth)
end
end
end
-
+
-- this goofy iterator allows nodes to be removed during the traversal
dochildren = function(parent, fn, depth)
local i = 1
@@ -213,7 +213,7 @@
end
end
end
-
+
-- set a default initial traversal depth, if one wasn't set
if not initialdepth then
initialdepth = 0