diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-10-31 03:51:37 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-10-31 03:52:00 -0700 |
| commit | 83219f8522271ae4f278abc5687921cc8267bb33 (patch) | |
| tree | 17ad8aa28d94d5442fac990cf3a0fae204d90850 /files.moon | |
| parent | ea3197aaffba00318920ed5e1e33ca5f2a5e6c5c (diff) | |
Bumped version number, fixed REPL, and simplified/fixed (use %).
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)* |} |
