|
@@ -188,6 +188,24 @@ M.generate_sip_v2 = function(path)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
+ -- Infer structure from paths and row ordering.
|
|
|
|
+ for i, v in ipairs(sip) do
|
|
|
|
+ for j = i + 1, #sip do
|
|
|
|
+ --print(string.format("comparing %s : %s", v.path, sip[j].path))
|
|
|
|
+ if not v["pas:next"] and
|
|
|
|
+ sip[j].path:match("(.*/)") == v.path:match("(.*/)") then
|
|
|
|
+ --print("next match.")
|
|
|
|
+ v["pas:next"] = sip[j].path
|
|
|
|
+ end
|
|
|
|
+ if not v["pas:firstChild"] and
|
|
|
|
+ sip[j].path:match("^" .. escape_pattern(v.path)) then
|
|
|
|
+ --print("First child match.")
|
|
|
|
+ v["pas:firstChild"] = sip[j].path
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+ v._sort = nil
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
|
|
return sip
|
|
return sip
|
|
end
|
|
end
|