ldoc
ldoc copied to clipboard
Representing module with constants
I have a simple module
return {
CONST1 = 'value1',
CONST2 = 'value2',
}
and I need to describe what CONST1 and CONST2 fields store and how they should be interpreted.
I understand that it is possible to write ldoc if my module was like that:
local const = {
CONST1 = 'value1',
CONST2 = 'value2',
}
return {
const = const,
-- something else
}
but I don't see any ways to describe a string (or number) field in module itself (similar to @function and @table).
See Inferring more from code. I would expect this work somehting like
-- @field CONST1 foo bar
-- @field CONST2 baz qiz
local const = {
CONST1 = 'value1',
CONST2 = 'value2',
}
return const
Does that not do what you expect?
See Inferring more from code. I would expect this work somehting like
-- @field CONST1 foo bar -- @field CONST2 baz qiz local const = { CONST1 = 'value1', CONST2 = 'value2', } return constDoes that not do what you expect?
Yes, page is empty if I try this. If I mix @table, page is empty too.

I use ldoc vs 1.4.6 and Tarantool 2.10.0-beta2-0-g9d80b68b9 as a lua interpreter.