| 2:3975fa5ed630 | 3:b2df1b3f2c83 |
|---|---|
| 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 |