summaryrefslogtreecommitdiff
path: root/Data/Libraries/LDoc/tests/simple/tables.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Data/Libraries/LDoc/tests/simple/tables.lua')
-rw-r--r--Data/Libraries/LDoc/tests/simple/tables.lua39
1 files changed, 39 insertions, 0 deletions
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
+