From 53364ddc2e09362cb17432abf4fb598557554a9f Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 30 Oct 2021 11:42:13 +0800 Subject: + LDoc --- Data/Libraries/LDoc/tests/simple/tables.lua | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Data/Libraries/LDoc/tests/simple/tables.lua (limited to 'Data/Libraries/LDoc/tests/simple/tables.lua') diff --git a/Data/Libraries/LDoc/tests/simple/tables.lua b/Data/Libraries/LDoc/tests/simple/tables.lua new file mode 100644 index 0000000..bdc612d --- /dev/null +++ b/Data/Libraries/LDoc/tests/simple/tables.lua @@ -0,0 +1,39 @@ +------------ +-- A module containing tables. +-- Shows how Lua table definitions can be conveniently parsed. +-- +-- There may be multiple comment lines per field/parameter, and +-- such comments may begin with `TYPE:` +-- +-- Functions also can be commented in a similar way, and the last +-- parameter's comment may be outside the parens. +-- +-- @alias M + +local tables = {} +local M = tables + +--- a function. +function M.one( + bonzo, -- dog + -- has its day! + frodo) --baggins +end + +--- first table. +-- @table one +M.one = { + A = 1, -- alpha + B = 2; -- beta +} + +--- second table. +-- we don't need an explicit table tag, since it +-- can be inferred from the context. +M.two = { + N = 10, -- int: no. of cases + L = 'label' -- string: case label +} + +return M + -- cgit v1.1-26-g67d0