Yalta is a ctags-like program that produces tags for source code files written in Lua. This is an experimental program made as a PoC for pool request to Universal Ctags.
This utility may be integrated with CtagsSourceNavigator plugin. Download latest stable version from releases page and unpack it. Open Far Manager and then open plugin configuration page (F11->Ctags Source Navigator->C Plugin configuration). Uncheck "Use built in ctags utility" and put full path to ctags_wrapper.bat script located in unpacked_release_folder\yalta\ctags_wrapper.bat.
Download latest stable version from releases page.
Build it from source code. See Build section.
:: Index single file:
yalta.bat path/to/file.lua > tags
:: Index directory recursive:
yalta.bat path/to/directory > tags
TODO: describe
Required CMake and compiler with C++11 support.
git clone https://github.com/EugeneManushkin/Yalta.git yalta
mkdir -p yalta/build && cd yalta/build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
Unlike the Universal Ctags Yalta recognizes language constructions separated with spaces, line breaks and comments.
Yalta recognizes dot and colon separated function scope and properly handles assignment of a first function in local variable list. Yalta handles function assignment to a global variable list in same way as Universal Ctags which is wrong. In real code assignment anonymous function to a global variable list is rare thow.
Language construction | Yalta | Universal Ctags |
---|---|---|
function aaa.bbb.ccc.foo(args) |
foo with class:aaa.bbb.ccc | aaa.bbb.ccc.name |
function aaa.bbb.ccc:foo(args) |
foo with class:aaa.bbb.ccc | aaa.bbb.ccc:name |
local function foo(args) |
foo | foo |
local foo = function(args) |
foo | foo |
local foo, aaa, bbb = function(args) ... end, ... |
foo | bbb |
foo = function(args) ... end, ... |
foo | foo |
aaa, bbb, foo = function(args) ... end, ... |
foo | foo |
{10, 20, foo = function(args) ... end, 30} |
foo | foo |
Yalta parses local variable lists. Variables of 'for' statement and function arguments are also parsed as local variables.
Language construction | Yalta | Universal Ctags |
---|---|---|
local aaa, bbb, ccc |
aaa, bbb, ccc | not implemented |
for key,value in pairs(t) do |
key, value | not implemented |
for index=1,10 do |
index | not implemented |
function foo(arg1, arg2, arg3) |
arg1, arg2, arg3 | not implemented |
call(function(arg1, arg2, arg3)) |
arg1, arg2, arg3 | not implemented |
Assignment to a sequence separated with dots is treated as a creation of a table key.
Language construction | Yalta | Universal Ctags |
---|---|---|
aaa, bbb, some.scope.key="value", ccc ... |
key with class:some.scope | not implemented |
Yalta generates tags for any assignment to a name that is not recognized as another known kind. Recognizing creation of global variables requires full-fledged language parsing. Capturing any assignment is much easyer and cover almost all cases of creation table keys or globals.
Language construction | Yalta | Universal Ctags |
---|---|---|
aaa, global_variable="value", bbb |
global_variable | not implemented |
local variable; variable = "value" |
variable | not implemented |
local t = {10, 20, key="value", 40} |
key | not implemented |
Call{10, 20, key="value", 40} |
key | not implemented |