Skip to content

duckafire/LIM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Last release LUA version

Indexes

Work in progress



Introduction

 The Lua Library Compactor, or only Lim, is a simple terminal program, to compact Lua scripts. It was created for easily the creation, maintain and update of libraries from Tiny Library, but nothing prevent that it will be used in other contexts.


Important

Lim cannot fix syntax and semantic errors in the code, it single objective is to compact the code and mantain it working after the process, if it does not work before the compaction, it will not be work after it.


Compaction process

 In summary, Lim will replace the identifiers to a lower string (foo -> f), will remove unnecessary white spaces and will group all the result content in a block do end, positioned in one line. In addition to the main line, there are other two, one above (with the declaration of the library table) and other below (with the declaration of the library name). Like this:


local _={}
do _.foo=function() return "foo" end end
local libfoo=_

Basic commands

# compact a file
lim file-name.lua [--replace] [--name \<output-file-name>]

# asking for help
lim --help [flag-name | help-argument]

# examples
lim foo.lua
lim foo1.lua --name FOO-1
lim --help
lim --help --replace

Known bugs

 For now, this list is empty :D