check builtin references. Builtin files are now all requireable (without module)
Steve Donovan
10 years ago
0 | 0 |
--- creating and controlling coroutines.
|
|
1 |
-- @module coroutine
|
1 | 2 |
|
2 | |
module 'coroutine'
|
|
3 |
local coroutine = {}
|
3 | 4 |
|
4 | 5 |
---
|
5 | 6 |
-- Creates a new coroutine, with body `f`. `f` must be a Lua
|
|
45 | 46 |
-- `yield` are passed as extra results to `resume`.
|
46 | 47 |
function coroutine.yield(...) end
|
47 | 48 |
|
|
49 |
return coroutine
|
0 | 0 |
--- getting runtime debug information.
|
|
1 |
-- @module debug
|
1 | 2 |
|
2 | |
module 'debug'
|
3 | |
|
|
3 |
local debug = {}
|
4 | 4 |
---
|
5 | 5 |
-- Enters an interactive mode with the user, running each string that
|
6 | 6 |
-- the user enters. Using simple commands and other debug facilities,
|
|
120 | 120 |
-- with the given index. Otherwise, it returns the name of the upvalue.
|
121 | 121 |
function debug.setupvalue(func, up, value) end
|
122 | 122 |
|
|
123 |
return debug
|
90 | 90 |
end
|
91 | 91 |
end
|
92 | 92 |
if tables[tbl] then -- function inside standard Lua table
|
|
93 |
local t = rawget(_G,tbl) -- do a quick sanity check
|
|
94 |
if not rawget(t,name) then
|
|
95 |
return nil
|
|
96 |
end
|
93 | 97 |
name = tbl..'.'..name
|
94 | 98 |
href = fun_ref..name
|
95 | 99 |
elseif xlibs[tbl] then -- in external libs, use LDoc style
|
|
100 |
local t = require('ldoc.builtin.'..tbl)
|
|
101 |
if not rawget(t,name) then
|
|
102 |
return nil
|
|
103 |
end
|
96 | 104 |
href = xlib_url..xlibs[tbl]..'#'..name
|
97 | 105 |
name = tbl..'.'..name
|
98 | 106 |
else
|
0 | 0 |
--- Reading and Writing Files.
|
|
1 |
-- @module io
|
1 | 2 |
|
2 | |
module 'io'
|
|
3 |
local io = {}
|
3 | 4 |
|
4 | 5 |
---
|
5 | 6 |
-- Equivalent to `file:close()`. Without a `file`, closes the default
|
|
154 | 155 |
-- `string.format` before `write`.
|
155 | 156 |
function file:write(...) end
|
156 | 157 |
|
|
158 |
return io
|
0 | 0 |
--- File and Directory manipulation
|
|
1 |
-- @module lfs
|
1 | 2 |
|
2 | |
module 'lfs'
|
|
3 |
local lfs = {}
|
3 | 4 |
|
4 | 5 |
---
|
5 | 6 |
-- Returns a table with the file attributes corresponding to filepath (or nil
|
|
72 | 73 |
-- and its length; both should be numbers.
|
73 | 74 |
-- Returns true if the operation was successful; in case of error, it returns
|
74 | 75 |
-- nil plus an error string.
|
75 | |
function lfs.lock(filehandle, mode, start, length)
|
|
76 |
function lfs.lock(filehandle, mode, start, length) end
|
76 | 77 |
|
77 | 78 |
---
|
78 | 79 |
-- Creates a new directory. The argument is the name of the new directory.
|
|
119 | 120 |
-- Returns true if the operation was successful; in case of error, it returns
|
120 | 121 |
-- nil plus an error string.
|
121 | 122 |
function lfs.unlock(filehandle, start, length) end
|
|
123 |
|
|
124 |
return lfs
|
0 | 0 |
--- LPeg PEG pattern matching.
|
1 | |
|
2 | |
module 'lpeg'
|
|
1 |
-- @module lpeg
|
|
2 |
|
|
3 |
local lpeg = {}
|
3 | 4 |
|
4 | 5 |
---
|
5 | 6 |
-- The matching function. It attempts to match the given pattern against the
|
|
208 | 209 |
-- Any extra values returned by the function become the values produced by the
|
209 | 210 |
-- capture.
|
210 | 211 |
function lpeg.Cmt(patt, function) end
|
|
212 |
|
|
213 |
return lpeg
|
0 | 0 |
--- standard mathematical functions.
|
|
1 |
-- @module math
|
1 | 2 |
|
2 | |
module 'math'
|
|
3 |
local math = {}
|
3 | 4 |
|
4 | 5 |
---
|
5 | 6 |
-- Returns the absolute value of `x`.
|
|
139 | 140 |
-- Returns the hyperbolic tangent of `x`.
|
140 | 141 |
function math.tanh(x) end
|
141 | 142 |
|
|
143 |
return math
|
0 | 0 |
--- Operating System facilities like date, time and program execution.
|
|
1 |
-- @module os
|
1 | 2 |
|
2 | |
module 'os'
|
|
3 |
local os = {}
|
3 | 4 |
|
4 | 5 |
---
|
5 | 6 |
-- Returns an approximation of the amount in seconds of CPU time used by
|
|
107 | 108 |
-- removes the file when the program ends.
|
108 | 109 |
function os.tmpname() end
|
109 | 110 |
|
|
111 |
return os
|
0 | 0 |
--- controlling how `require` finds packages.
|
|
1 |
-- @module package
|
1 | 2 |
|
2 | |
module 'package'
|
|
3 |
local package = {}
|
3 | 4 |
|
4 | 5 |
---
|
5 | 6 |
-- The path used by `require` to search for a C loader.
|
|
92 | 93 |
-- environment. To be used as an option to function `module`.
|
93 | 94 |
function package.seeall(module) end
|
94 | 95 |
|
|
96 |
return package
|
0 | 0 |
--- string operations like searching and matching.
|
|
1 |
-- @module string
|
1 | 2 |
|
2 | |
module 'string'
|
|
3 |
local string = {}
|
3 | 4 |
|
4 | 5 |
---
|
5 | 6 |
-- Returns the internal numerical codes of the characters `s[i]`, `s[i+1]`,
|
|
169 | 170 |
-- definition of what a lowercase letter is depends on the current locale.
|
170 | 171 |
function string.upper(s) end
|
171 | 172 |
|
|
173 |
return string
|
|
174 |
|
0 | 0 |
--- manipulating Lua tables.
|
|
1 |
-- @module table
|
1 | 2 |
|
2 | |
module 'table'
|
|
3 |
local table = {}
|
3 | 4 |
|
4 | 5 |
---
|
5 | 6 |
-- Given an array where all elements are strings or numbers, returns
|
|
38 | 39 |
-- (so that `not comp(a[i+1],a[i])` will be true after the sort). If `comp`
|
39 | 40 |
-- is not given, then the '<' operator will be used.
|
40 | 41 |
function table.sort(table , comp) end
|
|
42 |
|
|
43 |
return table
|