Sat, 12 Sep 2009 21:27:57 +0300
(don't know)
2 | 1 | |
2 | local hierarchy={} | |
3 | ||
4 | local function descend(hierarchy, dir) | |
5 | local loca=hierarchy | |
6 | string.gsub(dir, "([^/]+)", | |
7 | function(d) | |
8 | loca=hierarchy[d] | |
9 | assert(loca) | |
10 | end) | |
11 | return loca | |
12 | end | |
13 | ||
14 | -- Tai sit vaan jokainen dokumentti ilman extensiota. | |
15 | ||
16 | function get_shortcuts(dir) | |
17 | --local loca=descend(hierarchy, dir) | |
18 | return {} --append(loca, append(hierarchy, {})) | |
19 | end | |
20 | ||
21 | function get_environment(dir) | |
22 | return { | |
23 | location=dir, | |
24 | shortcuts=get_shortcuts(dir) | |
25 | } | |
26 | end |