summaryrefslogtreecommitdiff
path: root/Data/Libraries/LDoc/tests/styles/four.lua
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-30 11:42:13 +0800
committerchai <chaifix@163.com>2021-10-30 11:42:13 +0800
commit53364ddc2e09362cb17432abf4fb598557554a9f (patch)
tree8d2deafc82aceb13db31938a2aecc70927fc1457 /Data/Libraries/LDoc/tests/styles/four.lua
parent42ec7286b2d36a9ba22925f816a17cb1cc2aa5ce (diff)
+ LDoc
Diffstat (limited to 'Data/Libraries/LDoc/tests/styles/four.lua')
-rw-r--r--Data/Libraries/LDoc/tests/styles/four.lua59
1 files changed, 59 insertions, 0 deletions
diff --git a/Data/Libraries/LDoc/tests/styles/four.lua b/Data/Libraries/LDoc/tests/styles/four.lua
new file mode 100644
index 0000000..09f3bf0
--- /dev/null
+++ b/Data/Libraries/LDoc/tests/styles/four.lua
@@ -0,0 +1,59 @@
+------------
+-- Yet another module.
+-- Description can continue after simple tags, if you
+-- like - but to keep backwards compatibility, say 'not_luadoc=true'
+-- @module four
+-- @author bob, james
+-- @license MIT
+-- @copyright InfoReich 2013
+
+--- a function with typed args.
+-- Note the the standard tparam aliases, and how the 'opt' and 'optchain'
+-- modifiers may also be used. If the Lua function has varargs, then
+-- you may document an indefinite number of extra arguments!
+-- @tparam ?string|Person name person's name
+-- @int age
+-- @string[opt='gregorian'] calender optional calendar
+-- @int[opt=0] offset optional offset
+-- @treturn string
+-- @see file:write
+function one (name,age,...)
+end
+
+---- testing [opt]
+-- @param one
+-- @param[opt] two
+-- @param three
+-- @param[opt] four
+function two (one,two,three,four)
+end
+
+--- third useless function.
+-- Can always put comments inline, may
+-- be multiple.
+-- note that first comment refers to return type!
+function three ( -- person:
+ name, -- string: person's name
+ age -- int:
+ -- not less than zero!
+)
+end
+
+---- function with single optional arg
+-- @param[opt] one
+function four (one)
+end
+
+--- an implicit table.
+-- Again, we can use the comments
+person = {
+ name = '', -- string: name of person
+ age = 0, -- int:
+}
+
+--- an explicit table.
+-- Can now use tparam aliases in table defns
+-- @string name
+-- @int age
+-- @table person2
+