diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-05-09 20:34:32 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-05-09 20:35:11 -0700 |
| commit | 4e7b652014c3098c06235b2749f56934e08b9f51 (patch) | |
| tree | d438188b0028679aef80066ffcd4f6dd9fcc44ae /nomsu.moon | |
| parent | 1a755ddee807fe4e1b683f32b21d710dc78600a2 (diff) | |
Switched luajit to use custom built luajit lpeg, allowed `find` to
traverse symbolic links.
Diffstat (limited to 'nomsu.moon')
| -rwxr-xr-x | nomsu.moon | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -12,9 +12,7 @@ -- lua nomsu.lua [input_file [output_file or -]] export lpeg, re if jit - package.path = "LPegLJ/src/?.lua;#{package.path}" - lpeg = require 'lpeglj' - re = require 're' + package.cpath = "./luajit_lpeg/?.so;"..package.cpath export bit32 bit32 = require('bit') @@ -31,9 +29,9 @@ if jit if mt.__ipairs return mt.__ipairs(x) return _ipairs(x) -else - re = require 're' - lpeg = require 'lpeg' + +re = require 're' +lpeg = require 'lpeg' lpeg.setmaxstack 10000 {:P,:R,:V,:S,:Cg,:C,:Cp,:B,:Cmt} = lpeg utils = require 'utils' @@ -79,7 +77,7 @@ all_files = (path)-> return iterate_single, path -- TODO: improve sanitization path = path\gsub("\\","\\\\")\gsub("`","")\gsub('"','\\"')\gsub("$","") - return io.popen("find \""..path.."\" -type f -name \"*.nom\"")\lines! + return io.popen("find -L \""..path.."\" -type f -name \"*.nom\"")\lines! line_counter = re.compile([[ lines <- {| line (%nl line)* |} |
