[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] lua code formatter (lcf)
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 1 Feb 2017 07:26:47 -0200
Since you remove comments, you can reuse the Lua lexer.
This has the clear benefit that the lexing will be exactly what Lua does.
To reuse the Lua lexer, consider using my ltokenp
http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/index.html#ltokenp
http://lua-users.org/lists/lua-l/2016-05/msg00028.html
Also lua_reformat.sh can be simplified to
#!/bin/bash
lua << EOF
require('lcf.workshop.base')
local run = request('lcf.lua_reformat')
run('$1', '$2')
EOF
Thanks for sharing lcf.