forked from rpavlik/lua-docstring
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexamples.lua
More file actions
55 lines (39 loc) · 1 KB
/
examples.lua
File metadata and controls
55 lines (39 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
require("help")
a = help.docstring[[This is an example]] .. function()
print("this is the function")
return "function return value"
end
print("Before calling a")
print(a())
print("before calling help a")
help(a)
print("before defining b")
--docstring[[a second documented func]] ..
function b()
print("this is the second function")
end
help.docstring[[a second documented func]].applyTo(b)
help(b)
print("before defining random")
random =
help.docstring[[Compute random number.]] ..
help.docstring[[An extra docstring.]] ..
function(n)
return math.random(n)
end
print("before printing random")
print(random)
print("before printing results of random call")
print(random(5))
print("before help(random)")
help(random)
help(help, help.docstring)
if osgLua then
print("We have osgLua")
help(osg.PositionAttitudeTransform())
local xform = help.docstring[[The root transform.]] .. osg.PositionAttitudeTransform()
help(xform)
end
help.html.writeFile("help.htm",
help.html.documentRecursive("help", help)
)