File: mod1.lua

package info (click to toggle)
lua-ldoc 1.5.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 928 kB
  • sloc: makefile: 63; ansic: 56
file content (46 lines) | stat: -rw-r--r-- 999 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
------
-- always need a doc comment to start!
-- Can have a module with no internal doc comments,
-- although you will get a warning. At least we no
-- longer get a 'end-of-file' if there is no explicit
-- module name.

----- not a doc comment -----
-- a common style when just specifying an informative comment
-- May start with a doc comment but has trailing hyphens

local g -- so g below must be marked as local

--- simple.
--@param x a parameter
function _M.f(x) end

--- implicit local function.
-- Local functions appear in dump but only in docs if you say --all
local function L(t,v) end

--- explicit local function.
-- @local here
function g(a,b) end

--- a table of this module
_M.contents = {
    A = 'f', -- alpha
    B = 'g'  -- beta
}

--- another way to do parameters.
function _M.kay(
    a, -- ay
    b, -- bee
) end

--- a field of this module.
_M.constant = 'hello'

--- functions can also be like so.
_M.why = function(x,y)
end