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/styles/colon.lua | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Data/Libraries/LDoc/tests/styles/colon.lua (limited to 'Data/Libraries/LDoc/tests/styles/colon.lua') diff --git a/Data/Libraries/LDoc/tests/styles/colon.lua b/Data/Libraries/LDoc/tests/styles/colon.lua new file mode 100644 index 0000000..bb3ffea --- /dev/null +++ b/Data/Libraries/LDoc/tests/styles/colon.lua @@ -0,0 +1,35 @@ +---------------------- +-- Showing off Colon mode. +-- If you hate @ tags, you can use colons. However, you need to specify colon +-- mode explicitly -C or --colon, or `colon=true` in the config.ld. Be careful +-- not to use a colon followed by a space for any other purpose! +-- +-- So the incantation in this case is `ldoc -C colon.lua`. + +-- module: colon + + +--- first useless function. +-- Optional type specifiers are allowed in this format. +-- As an extension, '?T' is short for '?nil|T'. +-- Note how these types are rendered! +-- string: name +-- int: age +-- ?person3: options +-- treturn: ?table|string +function one (name,age,options) +end + +--- implicit table can always use colon notation. +person2 = { + id=true, -- string: official ID number + sex=true, -- string: one of 'M', 'F' or 'N' + spouse=true, -- ?person3: wife or husband +} + +--- explicit table in colon format. +-- Note how '!' lets you use a type name directly. +-- string: surname +-- string: birthdate +-- !person2: options +-- table: person3 -- cgit v1.1-26-g67d0