summaryrefslogtreecommitdiff
path: root/src/lua-script/script.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua-script/script.h')
-rw-r--r--src/lua-script/script.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/lua-script/script.h b/src/lua-script/script.h
index e29003f..9406097 100644
--- a/src/lua-script/script.h
+++ b/src/lua-script/script.h
@@ -237,13 +237,32 @@ const char *argent_script =
" return false\n"
" end\n"
"\n"
+ " function should_process(filename, parent)\n"
+ " if not string.match(filename, '%.lua$') then\n"
+ " return false\n"
+ " end\n"
+ " \n"
+ " if should_ignore(filename, parent) then\n"
+ " return false\n"
+ " end\n"
+ "\n"
+ " for pattern in pairs(argent.config.noprocess) do\n"
+ " if string.match(filename, pattern)\n"
+ " or string.match(parent..filename, pattern) then\n"
+ " return false\n"
+ " end\n"
+ " end\n"
+ "\n"
+ " return true\n"
+ " end\n"
+ "\n"
" function process_file(filename, parent)\n"
" if should_ignore(filename, parent) then\n"
" argent.log('debug', fmt('will not process file %q', parent..filename))\n"
" return\n"
" end\n"
"\n"
- " if string.match(filename, '%.lua$') and not argent.config.noprocess[filename] then\n"
+ " if should_process(filename, parent) then\n"
" argent.log('debug', fmt('processing %q as lua file', parent..filename))\n"
" process_lua_file(filename, parent)\n"
" else\n"