examples of syntax highlighting in function @usage blocks; 'static' member functions

This commit is contained in:
steve donovan 2013-03-05 17:57:55 +02:00
parent 95f293e67e
commit 987c5fbc9c
2 changed files with 43 additions and 0 deletions

5
tests/usage/config.ld Normal file
View File

@ -0,0 +1,5 @@
project = 'usage'
file = 'usage.lua'
format='markdown'
no_return_or_parms=true
no_summary=true

38
tests/usage/usage.lua Normal file
View File

@ -0,0 +1,38 @@
--[[--------
A simple module with examples.
@module usage
]]
local usage = {}
----------
-- A simple vector class
-- @type Vector
local Vector = {}
usage.Vector = {}
----------
-- Create a vector from an array `t`.
function Vector.new (t)
end
----------
-- Create a vector from a string.
-- @usage
-- v = Vector.parse '[1,2,3]'
-- assert (v == Vector.new {1,2,3})
function Vector.parse (s)
end
----------
-- Add another vector, array or scalar `v` to this vector.
-- Returns new `Vector`
-- @usage assert(Vector.new{1,2,3}:add(1) == Vector{2,3,4})
function Vector:add (v)
end
return usage