lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello Luiz,
lstrip does the job. 
thanks,
valerio

On Tue, Nov 9, 2010 at 2:34 PM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> is there anyone who hash a script (bash or others) that takes a .lua file
> and strips out all the comments (block, multiline, single line) ?

This is hard to do right with regular expressions. Better use the Lua lexer.
See for instance LuaSrcDiet and my lstrip:
       http://luasrcdiet.luaforge.net/
       http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lstrip