diff options
Diffstat (limited to 'files.moon')
| -rw-r--r-- | files.moon | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -33,7 +33,6 @@ Files.read = (filename)-> _FILE_CACHE[filename] = contents return contents --- `walk` returns an iterator over all files matching a path. {:match, :gsub} = string -- TODO: improve sanitization @@ -108,12 +107,9 @@ Files.walk = (path, flush_cache=false)-> else for nomsupath in package.nomsupath\gmatch("[^;]+") if files = browse(nomsupath.."/"..path) then break - iter = (files, i)-> - return unless files - i += 1 - if f = files[i] - return i, f - return iter, files, 0 + files or= {} + files = [gsub(f, "^%./", "") for f in *files] + return ipairs(files) line_counter = re.compile([[ lines <- {| line (%nl line)* |} |
