diff --git a/src/directive_provider.lua b/src/directive_provider.lua index 75c6563..f895ce6 100644 --- a/src/directive_provider.lua +++ b/src/directive_provider.lua @@ -16,6 +16,6 @@ limitations under the License. ]] ---#include "directives/define.lua" +---#include "directives/define.lua" --#include "directives/include.lua" --#include "directives/loadmod.lua" diff --git a/src/init.lua b/src/init.lua index aa5194d..dba2fa8 100644 --- a/src/init.lua +++ b/src/init.lua @@ -16,6 +16,7 @@ limitations under the License. ]] +--#include "luacomp_vars.lua" --#include "ast.lua" --#include "generator.lua" --#include "directive_provider.lua" @@ -25,7 +26,7 @@ local argparse = (function() --#include "argparse.lua" end)() -local parser = argparse(arg[0], "A Lua preprocessor+postprocessor.") +local parser = argparse(arg[0], "LuaComp v"..LUACOMP_VERSION.."\nA Lua preprocessor+postprocessor.") parser:argument("input", "Input file (- for STDIN)") parser:option("-O --output", "Output file. (- for STDOUT)", "-") parser:option("-m --minifier", "Sets the minifier", "none") @@ -60,4 +61,4 @@ if (args.executable) then end of:write(rcode) of:close() -f:close() \ No newline at end of file +f:close() diff --git a/src/luacomp_vars.lua b/src/luacomp_vars.lua new file mode 100644 index 0000000..9e44fb7 --- /dev/null +++ b/src/luacomp_vars.lua @@ -0,0 +1,10 @@ +local function _sv(k, v) + _G[k] = v + --os.setenv(k, tostring(v)) +end + +_sv("LUACOMP_V_MAJ", 1) +_sv("LUACOMP_V_MIN", 0) +_sv("LUACOMP_V_PAT", 0) +_sv("LUACOMP_VERSION", LUACOMP_V_MAJ.."."..LUACOMP_V_MIN.."."..LUACOMP_V_PAT) +_sv("LUACOMP_NAME", "LuaComp") \ No newline at end of file