diff options
| author | mbalmer <mbalmer@NetBSD.org> | 2015-10-08 12:46:20 +0000 |
|---|---|---|
| committer | mbalmer <mbalmer@NetBSD.org> | 2015-10-08 12:46:20 +0000 |
| commit | 14a62719979f511f0c63a80b66d3ca7202ffc862 (patch) | |
| tree | 1c63ddf1b955cbdccc83380d6f1978b06832e934 /external/mit/lua | |
| parent | 4e8e1186b2bbfdf537c53eccd2e6e2dffc112a70 (diff) | |
update docs after conflict resolution
Diffstat (limited to 'external/mit/lua')
| -rw-r--r-- | external/mit/lua/dist/doc/contents.html | 37 | ||||
| -rw-r--r-- | external/mit/lua/dist/doc/lua.css | 106 | ||||
| -rw-r--r-- | external/mit/lua/dist/doc/manual.css | 14 | ||||
| -rw-r--r-- | external/mit/lua/dist/doc/manual.html | 372 | ||||
| -rw-r--r-- | external/mit/lua/dist/doc/readme.html | 36 |
5 files changed, 299 insertions, 266 deletions
diff --git a/external/mit/lua/dist/doc/contents.html b/external/mit/lua/dist/doc/contents.html index e59e4215eee..1272c59cdf0 100644 --- a/external/mit/lua/dist/doc/contents.html +++ b/external/mit/lua/dist/doc/contents.html @@ -3,35 +3,34 @@ <HEAD> <TITLE>Lua 5.3 Reference Manual - contents</TITLE> <LINK REL="stylesheet" TYPE="text/css" HREF="lua.css"> +<LINK REL="stylesheet" TYPE="text/css" HREF="index.css"> <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1"> -<STYLE TYPE="text/css"> -ul { - list-style-type: none ; - list-style-position: outside ; -} -</STYLE> </HEAD> <BODY> -<HR> <H1> -<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="" BORDER=0></A> +<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A> Lua 5.3 Reference Manual </H1> <P> The reference manual is the official definition of the Lua language. +<BR> For a complete introduction to Lua programming, see the book <A HREF="http://www.lua.org/pil/">Programming in Lua</A>. -<P> +<DIV CLASS="menubar"> <A HREF="manual.html">start</A> · <A HREF="#contents">contents</A> · <A HREF="#index">index</A> -<HR> +· +<A HREF="http://www.lua.org/manual/">other versions</A> +</DIV> + +<P> <SMALL> Copyright © 2015 Lua.org, PUC-Rio. Freely available under the terms of the @@ -39,7 +38,7 @@ Freely available under the terms of the </SMALL> <H2><A NAME="contents">Contents</A></H2> -<UL style="padding: 0"> +<UL CLASS="contents menubar"> <LI><A HREF="manual.html">1 – Introduction</A> <P> <LI><A HREF="manual.html#2">2 – Basic Concepts</A> @@ -136,15 +135,14 @@ Freely available under the terms of the </UL> <H2><A NAME="index">Index</A></H2> -<TABLE WIDTH="100%"> -<TR VALIGN="top"> +<TABLE CLASS="menubar" WIDTH="100%"> +<TR> <TD> <H3><A NAME="functions">Lua functions</A></H3> <P> <A HREF="manual.html#6.1">basic</A><BR> <A HREF="manual.html#pdf-_G">_G</A><BR> <A HREF="manual.html#pdf-_VERSION">_VERSION</A><BR> - <A HREF="manual.html#pdf-assert">assert</A><BR> <A HREF="manual.html#pdf-collectgarbage">collectgarbage</A><BR> <A HREF="manual.html#pdf-dofile">dofile</A><BR> @@ -321,6 +319,7 @@ Freely available under the terms of the <A HREF="manual.html#pdf-utf8.offset">utf8.offset</A><BR> <H3><A NAME="env">environment<BR>variables</A></H3> +<P> <A HREF="manual.html#pdf-LUA_CPATH">LUA_CPATH</A><BR> <A HREF="manual.html#pdf-LUA_CPATH_5_3">LUA_CPATH_5_3</A><BR> <A HREF="manual.html#pdf-LUA_INIT">LUA_INIT</A><BR> @@ -546,6 +545,7 @@ Freely available under the terms of the <A HREF="manual.html#pdf-luaopen_utf8">luaopen_utf8</A><BR> <H3><A NAME="constants">constants</A></H3> +<P> <A HREF="manual.html#pdf-LUA_ERRERR">LUA_ERRERR</A><BR> <A HREF="manual.html#pdf-LUA_ERRFILE">LUA_ERRFILE</A><BR> <A HREF="manual.html#pdf-LUA_ERRGCMM">LUA_ERRGCMM</A><BR> @@ -606,13 +606,12 @@ Freely available under the terms of the </TR> </TABLE> -<HR> -<SMALL CLASS="footer"> +<P CLASS="footer"> Last update: -Tue Dec 9 21:26:07 BRST 2014 -</SMALL> +Wed Jun 3 08:27:30 BRT 2015 +</P> <!-- -Last change: updated for Lua 5.3.0 (final) +Last change: revised for Lua 5.3.1 --> </BODY> diff --git a/external/mit/lua/dist/doc/lua.css b/external/mit/lua/dist/doc/lua.css index 3199a2b6e8f..b614f3c084a 100644 --- a/external/mit/lua/dist/doc/lua.css +++ b/external/mit/lua/dist/doc/lua.css @@ -3,84 +3,90 @@ html { } body { - border: solid #a0a0a0 1px ; - border-radius: 20px ; - padding: 26px ; - margin: 16px ; - color: #000000 ; background-color: #FFFFFF ; + color: #000000 ; font-family: Helvetica, Arial, sans-serif ; text-align: justify ; + line-height: 1.25 ; + margin: 16px auto ; + padding: 32px ; + border: solid #a0a0a0 1px ; + border-radius: 20px ; + max-width: 70em ; + width: 90% ; } h1, h2, h3, h4 { + color: #000080 ; font-family: Verdana, Geneva, sans-serif ; font-weight: normal ; font-style: normal ; + text-align: left ; } -h2 { - padding-top: 0.4em ; - padding-bottom: 0.4em ; - padding-left: 0.8em ; - padding-right: 0.8em ; - background-color: #D0D0FF ; - border-radius: 8px ; - border: solid #a0a0a0 1px ; +h1 { + font-size: 28pt ; } -h3 { - padding-left: 0.5em ; - border-left: solid #D0D0FF 1em ; +h1 img { + vertical-align: text-bottom ; } -table h3 { - padding-left: 0px ; - border-left: none ; +h2:before { + content: "\2756" ; + padding-right: 0.5em ; } -a:link { - color: #000080 ; - background-color: inherit ; +a { text-decoration: none ; } -a:visited { - background-color: inherit ; - text-decoration: none ; +a:link { + color: #000080 ; } a:link:hover, a:visited:hover { - color: #000080 ; background-color: #D0D0FF ; - border-radius: 4px; + color: #000080 ; + border-radius: 4px ; } a:link:active, a:visited:active { color: #FF0000 ; } -h1 a img { - vertical-align: text-bottom ; +div.menubar { + padding-bottom: 0.5em ; } -hr { - border: 0 ; - height: 1px ; - color: #a0a0a0 ; - background-color: #a0a0a0 ; - display: none ; +p.menubar { + margin-left: 2.5em ; } -table hr { - display: block ; +.menubar a:hover { + margin: -3px -3px -3px -3px ; + padding: 3px 3px 3px 3px ; + border-radius: 4px ; } :target { - background-color: #F8F8F8 ; + background-color: #F0F0F0 ; + margin: -8px ; padding: 8px ; - border: solid #a0a0a0 2px ; border-radius: 8px ; + outline: none ; +} + +hr { + display: none ; +} + +table hr { + background-color: #a0a0a0 ; + color: #a0a0a0 ; + border: 0 ; + height: 1px ; + display: block ; } .footer { @@ -103,3 +109,25 @@ pre.session { padding: 1em ; border-radius: 8px ; } + +td.gutter { + width: 4% ; +} + +table.columns { + border: none ; + border-spacing: 0 ; + border-collapse: collapse ; +} + +table.columns td { + vertical-align: top ; + padding: 0 ; + padding-bottom: 1em ; + text-align: justify ; + line-height: 1.25 ; +} + +p.logos a:link:hover, p.logos a:visited:hover { + background-color: inherit ; +} diff --git a/external/mit/lua/dist/doc/manual.css b/external/mit/lua/dist/doc/manual.css index ca613cd9fb1..aa0e677dd52 100644 --- a/external/mit/lua/dist/doc/manual.css +++ b/external/mit/lua/dist/doc/manual.css @@ -8,20 +8,14 @@ pre, code { } span.apii { + color: gray ; float: right ; font-family: inherit ; font-style: normal ; font-size: small ; - color: gray ; } -p+h1, ul+h1 { - font-style: normal ; - padding-top: 0.4em ; - padding-bottom: 0.4em ; - padding-left: 16px ; - margin-left: -16px ; - background-color: #D0D0FF ; - border-radius: 8px ; - border: solid #000080 1px ; +h2:before { + content: "" ; + padding-right: 0em ; } diff --git a/external/mit/lua/dist/doc/manual.html b/external/mit/lua/dist/doc/manual.html index 77ec7576f6d..63d28ae0c2f 100644 --- a/external/mit/lua/dist/doc/manual.html +++ b/external/mit/lua/dist/doc/manual.html @@ -1,39 +1,41 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> - -<head> -<title>Lua 5.3 Reference Manual</title> -<link rel="stylesheet" type="text/css" href="lua.css"> -<link rel="stylesheet" type="text/css" href="manual.css"> +<HTML> +<HEAD> +<TITLE>Lua 5.3 Reference Manual</TITLE> +<LINK REL="stylesheet" TYPE="text/css" HREF="lua.css"> +<LINK REL="stylesheet" TYPE="text/css" HREF="manual.css"> <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1"> -</head> +</HEAD> -<body> +<BODY> -<hr> -<h1> -<a href="http://www.lua.org/"><img src="logo.gif" alt="" border="0"></a> +<H1> +<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A> Lua 5.3 Reference Manual -</h1> +</H1> +<P> by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes -<p> -<small> + +<P> +<SMALL> Copyright © 2015 Lua.org, PUC-Rio. Freely available under the terms of the <a href="http://www.lua.org/license.html">Lua license</a>. -</small> -<hr> -<p> +</SMALL> -<a href="contents.html#contents">contents</A> +<DIV CLASS="menubar"> +<A HREF="contents.html#contents">contents</A> +· +<A HREF="contents.html#index">index</A> · -<a href="contents.html#index">index</A> +<A HREF="http://www.lua.org/manual/">other versions</A> +</DIV> <!-- ====================================================================== --> <p> -<!-- Id: manual.of,v 1.146 2015/01/06 11:23:01 roberto Exp --> +<!-- Id: manual.of,v 1.151 2015/06/10 21:08:57 roberto Exp --> @@ -113,15 +115,15 @@ There are eight basic types in Lua: <em>nil</em>, <em>boolean</em>, <em>number</em>, <em>string</em>, <em>function</em>, <em>userdata</em>, <em>thread</em>, and <em>table</em>. -<em>Nil</em> is the type of the value <b>nil</b>, +The type <em>nil</em> has one single value, <b>nil</b>, whose main property is to be different from any other value; it usually represents the absence of a useful value. -<em>Boolean</em> is the type of the values <b>false</b> and <b>true</b>. +The type <em>boolean</em> has two values, <b>false</b> and <b>true</b>. Both <b>nil</b> and <b>false</b> make a condition false; any other value makes it true. -<em>Number</em> represents both +The type <em>number</em> represents both integer numbers and real (floating-point) numbers. -<em>String</em> represents immutable sequences of bytes. +The type <em>string</em> represents immutable sequences of bytes. Lua is 8-bit clean: strings can contain any 8-bit value, @@ -132,6 +134,7 @@ it makes no assumptions about the contents of a string. <p> The type <em>number</em> uses two internal representations, +or two subtypes, one called <em>integer</em> and the other called <em>float</em>. Lua has explicit rules about when each representation is used, but it also converts between them automatically as needed (see <a href="#3.4.3">§3.4.3</a>). @@ -142,7 +145,7 @@ or to assume complete control over the representation of each number. Standard Lua uses 64-bit integers and double-precision (64-bit) floats, but you can also compile Lua so that it uses 32-bit integers and/or single-precision (32-bit) floats. -The option with 32 bits for both integers and floats +The option with 32 bits for both integers and floats is particularly attractive for small machines and embedded systems. (See macro <code>LUA_32BITS</code> in file <code>luaconf.h</code>.) @@ -185,8 +188,8 @@ even those that do not support threads natively. The type <em>table</em> implements associative arrays, that is, arrays that can be indexed not only with numbers, but with any Lua value except <b>nil</b> and NaN. -(<em>Not a Number</em> is a special numeric value used to represent -undefined or unrepresentable results, such as <code>0/0</code>.) +(<em>Not a Number</em> is a special value used to represent +undefined or unrepresentable numerical results, such as <code>0/0</code>.) Tables can be <em>heterogeneous</em>; that is, they can contain values of all types (except <b>nil</b>). Any key with value <b>nil</b> is not considered part of the table. @@ -393,7 +396,7 @@ using the <a href="#pdf-getmetatable"><code>getmetatable</code></a> function. <p> You can replace the metatable of tables using the <a href="#pdf-setmetatable"><code>setmetatable</code></a> function. -You cannot change the metatable of other types from Lua +You cannot change the metatable of other types from Lua code (except by using the debug library (<a href="#6.10">§6.10</a>)); you must use the C API for that. @@ -425,12 +428,7 @@ for instance, the key for operation "add" is the string "<code>__add</code>". Note that queries for metamethods are always raw; the access to a metamethod does not invoke other metamethods. -You can emulate how Lua queries a metamethod for an object <code>obj</code> -with the following code: -<pre> - rawget(getmetatable(obj) or {}, "__" .. event_name) -</pre> <p> For the unary operators (negation, length, and bitwise not), @@ -510,7 +508,7 @@ the <code>&</code> (bitwise and) operation. Behavior similar to the "add" operation, except that Lua will try a metamethod -if any operator is neither an integer +if any operand is neither an integer nor a value coercible to an integer (see <a href="#3.4.3">§3.4.3</a>). </li> @@ -549,7 +547,7 @@ the <code>..</code> (concatenation) operation. Behavior similar to the "add" operation, except that Lua will try a metamethod -if any operator is neither a string nor a number +if any operand is neither a string nor a number (which is always coercible to a string). </li> @@ -599,6 +597,8 @@ then it will try the "<code>__lt</code>" event, assuming that <code>a <= b</code> is equivalent to <code>not (b < a)</code>. As with the other comparison operators, the result is always a boolean. +(This use of the "<code>__lt</code>" event can be removed in future versions; +it is also slower than a real "<code>__le</code>" metamethod.) </li> <li><b>"index": </b> @@ -661,6 +661,13 @@ followed by the arguments of the original call (<code>args</code>). </ul> +<p> +It is a good practice to add all needed metamethods to a table +before setting it as a metatable of some object. +In particular, the "<code>__gc</code>" metamethod works only when this order +is followed (see <a href="#2.5.1">§2.5.1</a>). + + @@ -752,8 +759,6 @@ and the metatable has a field indexed by the string "<code>__gc</code>". Note that if you set a metatable without a <code>__gc</code> field and later create that field in the metatable, the object will not be marked for finalization. -However, after an object has been marked, -you can freely change the <code>__gc</code> field of its metatable. <p> @@ -794,7 +799,7 @@ Moreover, if the finalizer marks a finalizing object for finalization again, its finalizer will be called again in the next cycle where the object is unreachable. In any case, -the object memory is freed only in the GC cycle where +the object memory is freed only in a GC cycle where the object is unreachable and not marked for finalization. @@ -822,8 +827,8 @@ then the garbage collector will collect that object. <p> A weak table can have weak keys, weak values, or both. -A table with weak keys allows the collection of its keys, -but prevents the collection of its values. +A table with weak values allows the collection of its values, +but prevents the collection of its keys. A table with both weak keys and weak values allows the collection of both keys and values. In any case, if either the key or the value is collected, @@ -913,10 +918,10 @@ You execute a coroutine by calling <a href="#pdf-coroutine.resume"><code>corouti When you first call <a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a>, passing as its first argument a thread returned by <a href="#pdf-coroutine.create"><code>coroutine.create</code></a>, -the coroutine starts its execution, -at the first line of its main function. +the coroutine starts its execution by +calling its main function. Extra arguments passed to <a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a> are passed -as arguments to the coroutine's main function. +as arguments to that function. After the coroutine starts running, it runs until it terminates or <em>yields</em>. @@ -1111,7 +1116,7 @@ into the string contents. Strings in Lua can contain any 8-bit value, including embedded zeros, which can be specified as '<code>\0</code>'. More generally, -we can specify any byte in a literal string by its numerical value. +we can specify any byte in a literal string by its numeric value. This can be done with the escape sequence <code>\x<em>XX</em></code>, where <em>XX</em> is a sequence of exactly two hexadecimal digits, @@ -1186,7 +1191,7 @@ the five literal strings below denote the same string: </pre> <p> -A <em>numerical constant</em> (or <em>numeral</em>) +A <em>numeric constant</em> (or <em>numeral</em>) can be written with an optional fractional part and an optional decimal exponent, marked by a letter '<code>e</code>' or '<code>E</code>'. @@ -1581,11 +1586,11 @@ because now <b>return</b> is the last statement in its (inner) block. <p> The <b>for</b> statement has two forms: -one numeric and one generic. +one numerical and one generic. <p> -The numeric <b>for</b> loop repeats a block of code while a +The numerical <b>for</b> loop repeats a block of code while a control variable runs through an arithmetic progression. It has the following syntax: @@ -1879,13 +1884,13 @@ so that it works for non-integer exponents too. <p> Floor division (<code>//</code>) is a division -that rounds the quotient towards minus infinite, +that rounds the quotient towards minus infinity, that is, the floor of the division of its operands. <p> Modulo is defined as the remainder of a division -that rounds the quotient towards minus infinite (floor division). +that rounds the quotient towards minus infinity (floor division). <p> @@ -1972,8 +1977,9 @@ The conversion from strings to numbers goes as follows: First, the string is converted to an integer or a float, following its syntax and the rules of the Lua lexer. (The string may have also leading and trailing spaces and a sign.) -Then, the resulting number is converted to the required type -(float or integer) according to the previous rules. +Then, the resulting number (float or integer) +is converted to the type (float or integer) required by the context +(e.g., the operation that forced the conversion). <p> @@ -2006,11 +2012,7 @@ Equality (<code>==</code>) first compares the type of its operands. If the types are different, then the result is <b>false</b>. Otherwise, the values of the operands are compared. Strings are compared in the obvious way. -Numbers follow the usual rule for binary operations: -if both operands are integers, -they are compared as integers; -otherwise, they are converted to floats -and compared as such. +Numbers are equal if they denote the same mathematical value. <p> @@ -2045,8 +2047,8 @@ The operator <code>~=</code> is exactly the negation of equality (<code>==</code <p> The order operators work as follows. If both arguments are numbers, -then they are compared following -the usual rule for binary operations. +then they are compared according to their mathematical values +(regardless of their subtypes). Otherwise, if both arguments are strings, then their values are compared according to the current locale. Otherwise, Lua tries to call the "lt" or the "le" @@ -2055,6 +2057,12 @@ A comparison <code>a > b</code> is translated to <code>b < a</code> and <code>a >= b</code> is translated to <code>b <= a</code>. +<p> +Following the IEEE 754 standard, +NaN is considered neither smaller than, +nor equal to, nor greater than any value (including itself). + + @@ -2636,29 +2644,22 @@ works only with <em>valid indices</em> or <em>acceptable indices</em>. <p> A <em>valid index</em> is an index that refers to a -real position within the stack, that is, -its position lies between 1 and the stack top -(<code>1 ≤ abs(index) ≤ top</code>). - -Usually, functions that can modify the value at an index -require valid indices. - - -<p> -Unless otherwise noted, -any function that accepts valid indices also accepts <em>pseudo-indices</em>, -which represent some Lua values that are accessible to C code -but which are not in the stack. -Pseudo-indices are used to access the registry +position that stores a modifiable Lua value. +It comprises stack indices between 1 and the stack top +(<code>1 ≤ abs(index) ≤ top</code>) + +plus <em>pseudo-indices</em>, +which represent some positions that are accessible to C code +but that are not in the stack. +Pseudo-indices are used to access the registry (see <a href="#4.5">§4.5</a>) and the upvalues of a C function (see <a href="#4.4">§4.4</a>). <p> -Functions that do not need a specific stack position, -but only a value in the stack (e.g., query functions), +Functions that do not need a specific mutable position, +but only a value (e.g., query functions), can be called with acceptable indices. An <em>acceptable index</em> can be any valid index, -including the pseudo-indices, but it also can be any positive index after the stack top within the space allocated for the stack, that is, indices up to the stack size. @@ -2701,7 +2702,7 @@ Whenever a C function is called, its upvalues are located at specific pseudo-indices. These pseudo-indices are produced by the macro <a href="#lua_upvalueindex"><code>lua_upvalueindex</code></a>. -The first value associated with a function is at position +The first upvalue associated with a function is at index <code>lua_upvalueindex(1)</code>, and so on. Any access to <code>lua_upvalueindex(<em>n</em>)</code>, where <em>n</em> is greater than the number of upvalues of the @@ -2719,8 +2720,7 @@ Lua provides a <em>registry</em>, a predefined table that can be used by any C code to store whatever Lua values it needs to store. The registry table is always located at pseudo-index -<a name="pdf-LUA_REGISTRYINDEX"><code>LUA_REGISTRYINDEX</code></a>, -which is a valid index. +<a name="pdf-LUA_REGISTRYINDEX"><code>LUA_REGISTRYINDEX</code></a>. Any C library can store data into this table, but it must take care to choose keys that are different from those used @@ -2981,7 +2981,8 @@ tells whether the function may raise errors: <pre>int lua_absindex (lua_State *L, int idx);</pre> <p> -Converts the acceptable index <code>idx</code> into an absolute index +Converts the acceptable index <code>idx</code> +into an equivalent absolute index (that is, one that does not depend on the stack top). @@ -3224,7 +3225,7 @@ many results. <p> As an example, the following function receives a variable number -of numerical arguments and returns their average and their sum: +of numeric arguments and returns their average and their sum: <pre> static int foo (lua_State *L) { @@ -3383,8 +3384,9 @@ to write them. <p> If <code>strip</code> is true, -the binary representation is created without debug information -about the function. +the binary representation may not include all debug information +about the function, +to save space. <p> @@ -3661,7 +3663,7 @@ By default this type is <code>long long</code>, (usually a 64-bit two-complement integer), but that can be changed to <code>long</code> or <code>int</code> (usually a 32-bit two-complement integer). -(See <code>LUA_INT</code> in <code>luaconf.h</code>.) +(See <code>LUA_INT_TYPE</code> in <code>luaconf.h</code>.) <p> @@ -3850,7 +3852,7 @@ and 0 otherwise. <p> The type for continuation-function contexts. -It must be a numerical type. +It must be a numeric type. This type is defined as <code>intptr_t</code> when <code>intptr_t</code> is available, so that it can store pointers too. @@ -4068,7 +4070,7 @@ the table during its traversal. <hr><h3><a name="lua_Number"><code>lua_Number</code></a></h3> -<pre>typedef double lua_Number;</pre> +<pre>typedef ... lua_Number;</pre> <p> The type of floats in Lua. @@ -4076,8 +4078,8 @@ The type of floats in Lua. <p> By default this type is double, -but that can be changed to a single float. -(See <code>LUA_REAL</code> in <code>luaconf.h</code>.) +but that can be changed to a single float or a long double. +(See <code>LUA_FLOAT_TYPE</code> in <code>luaconf.h</code>.) @@ -4133,7 +4135,7 @@ then the error message returned on the stack is exactly the original error message. Otherwise, <code>msgh</code> is the stack index of a <em>message handler</em>. -(In the current implementation, this index cannot be a pseudo-index.) +(This index cannot be a pseudo-index.) In case of runtime errors, this function will be called with the error message and its return value will be the message @@ -4267,20 +4269,11 @@ when called, invokes the corresponding C function. <p> -Any function to be registered in Lua must +Any function to be callable by Lua must follow the correct protocol to receive its parameters and return its results (see <a href="#lua_CFunction"><code>lua_CFunction</code></a>). -<p> -<code>lua_pushcfunction</code> is defined as a macro: - -<pre> - #define lua_pushcfunction(L,f) lua_pushcclosure(L,f,0) -</pre><p> -Note that <code>f</code> is used twice. - - @@ -4309,7 +4302,7 @@ The conversion specifiers can only be '<code>%%</code>' (inserts the character '<code>%</code>'), '<code>%s</code>' (inserts a zero-terminated string, with no size restrictions), '<code>%f</code>' (inserts a <a href="#lua_Number"><code>lua_Number</code></a>), -'<code>%L</code>' (inserts a <a href="#lua_Integer"><code>lua_Integer</code></a>), +'<code>%I</code>' (inserts a <a href="#lua_Integer"><code>lua_Integer</code></a>), '<code>%p</code>' (inserts a pointer as a hexadecimal numeral), '<code>%d</code>' (inserts an <code>int</code>), '<code>%c</code>' (inserts an <code>int</code> as a one-byte character), and @@ -4369,9 +4362,8 @@ light userdata with the same C address. <pre>const char *lua_pushliteral (lua_State *L, const char *s);</pre> <p> -This macro is equivalent to <a href="#lua_pushlstring"><code>lua_pushlstring</code></a>, -but can be used only when <code>s</code> is a literal string. -It automatically provides the string length. +This macro is equivalent to <a href="#lua_pushstring"><code>lua_pushstring</code></a>, +but should be used only when <code>s</code> is a literal string. @@ -4598,9 +4590,9 @@ that is, it does not invoke metamethods. <pre>void lua_rawsetp (lua_State *L, int index, const void *p);</pre> <p> -Does the equivalent of <code>t[k] = v</code>, +Does the equivalent of <code>t[p] = v</code>, where <code>t</code> is the table at the given index, -<code>k</code> is the pointer <code>p</code> represented as a light userdata, +<code>p</code> is encoded as a light userdata, and <code>v</code> is the value at the top of the stack. @@ -4672,7 +4664,7 @@ because a pseudo-index is not an actual stack position. <p> Moves the top element into the given valid index without shifting any element -(therefore replacing the value at the given index), +(therefore replacing the value at that given index), and then pops the top element. @@ -4684,7 +4676,7 @@ and then pops the top element. <pre>int lua_resume (lua_State *L, lua_State *from, int nargs);</pre> <p> -Starts and resumes a coroutine in a given thread. +Starts and resumes a coroutine in the given thread <code>L</code>. <p> @@ -4731,12 +4723,16 @@ this parameter can be <code>NULL</code>. <pre>void lua_rotate (lua_State *L, int idx, int n);</pre> <p> -Rotates the stack elements from <code>idx</code> to the top <code>n</code> positions -in the direction of the top, for a positive <code>n</code>, +Rotates the stack elements between the valid index <code>idx</code> +and the top of the stack. +The elements are rotated <code>n</code> positions in the direction of the top, +for a positive <code>n</code>, or <code>-n</code> positions in the direction of the bottom, for a negative <code>n</code>. The absolute value of <code>n</code> must not be greater than the size of the slice being rotated. +This function cannot be called with a pseudo-index, +because a pseudo-index is not an actual stack position. @@ -5072,7 +5068,7 @@ There is no way to convert the pointer back to its original value. <p> -Typically this function is used only for debug information. +Typically this function is used only for hashing and debug information. @@ -5127,7 +5123,7 @@ Returns the type of the value in the given valid index, or <code>LUA_TNONE</code> for a non-valid (but acceptable) index. The types returned by <a href="#lua_type"><code>lua_type</code></a> are coded by the following constants defined in <code>lua.h</code>: -<a name="pdf-LUA_TNIL"><code>LUA_TNIL</code></a>, +<a name="pdf-LUA_TNIL"><code>LUA_TNIL</code></a> (0), <a name="pdf-LUA_TNUMBER"><code>LUA_TNUMBER</code></a>, <a name="pdf-LUA_TBOOLEAN"><code>LUA_TBOOLEAN</code></a>, <a name="pdf-LUA_TSTRING"><code>LUA_TSTRING</code></a>, @@ -5618,24 +5614,26 @@ it returns 0. <pre>const char *lua_getupvalue (lua_State *L, int funcindex, int n);</pre> <p> -Gets information about a closure's upvalue. -(For Lua functions, -upvalues are the external local variables that the function uses, -and that are consequently included in its closure.) -<a href="#lua_getupvalue"><code>lua_getupvalue</code></a> gets the index <code>n</code> of an upvalue, -pushes the upvalue's value onto the stack, +Gets information about the <code>n</code>-th upvalue +of the closure at index <code>funcindex</code>. +It pushes the upvalue's value onto the stack and returns its name. -<code>funcindex</code> points to the closure in the stack. -(Upvalues have no particular order, -as they are active through the whole function. -So, they are numbered in an arbitrary order.) +Returns <code>NULL</code> (and pushes nothing) +when the index <code>n</code> is greater than the number of upvalues. <p> -Returns <code>NULL</code> (and pushes nothing) -when the index is greater than the number of upvalues. For C functions, this function uses the empty string <code>""</code> as a name for all upvalues. +(For Lua functions, +upvalues are the external local variables that the function uses, +and that are consequently included in its closure.) + + +<p> +Upvalues have no particular order, +as they are active through the whole function. +They are numbered in an arbitrary order. @@ -5680,10 +5678,10 @@ that is, they cannot call <a href="#lua_yieldk"><code>lua_yieldk</code></a>, <p> Hook functions can yield under the following conditions: -Only count and line events can yield -and they cannot yield any value; -to yield a hook function must finish its execution -calling <a href="#lua_yield"><code>lua_yield</code></a> with <code>nresults</code> equal to zero. +Only count and line events can yield; +to yield, a hook function must finish its execution +calling <a href="#lua_yield"><code>lua_yield</code></a> with <code>nresults</code> equal to zero +(that is, with no values). @@ -5748,9 +5746,7 @@ A hook is disabled by setting <code>mask</code> to zero. <p> Sets the value of a local variable of a given activation record. -Parameters <code>ar</code> and <code>n</code> are as in <a href="#lua_getlocal"><code>lua_getlocal</code></a> -(see <a href="#lua_getlocal"><code>lua_getlocal</code></a>). -<a href="#lua_setlocal"><code>lua_setlocal</code></a> assigns the value at the top of the stack +It assigns the value at the top of the stack to the variable and returns its name. It also pops the value from the stack. @@ -5761,6 +5757,10 @@ when the index is greater than the number of active local variables. +<p> +Parameters <code>ar</code> and <code>n</code> are as in function <a href="#lua_getlocal"><code>lua_getlocal</code></a>. + + @@ -5773,13 +5773,15 @@ Sets the value of a closure's upvalue. It assigns the value at the top of the stack to the upvalue and returns its name. It also pops the value from the stack. -Parameters <code>funcindex</code> and <code>n</code> are as in the <a href="#lua_getupvalue"><code>lua_getupvalue</code></a> -(see <a href="#lua_getupvalue"><code>lua_getupvalue</code></a>). <p> Returns <code>NULL</code> (and pops nothing) -when the index is greater than the number of upvalues. +when the index <code>n</code> is greater than the number of upvalues. + + +<p> +Parameters <code>funcindex</code> and <code>n</code> are as in function <a href="#lua_getupvalue"><code>lua_getupvalue</code></a>. @@ -5792,9 +5794,6 @@ when the index is greater than the number of upvalues. <p> Returns a unique identifier for the upvalue numbered <code>n</code> from the closure at index <code>funcindex</code>. -Parameters <code>funcindex</code> and <code>n</code> are as in the <a href="#lua_getupvalue"><code>lua_getupvalue</code></a> -(see <a href="#lua_getupvalue"><code>lua_getupvalue</code></a>) -(but <code>n</code> cannot be greater than the number of upvalues). <p> @@ -5805,6 +5804,11 @@ Lua closures that share an upvalue will return identical ids for those upvalue indices. +<p> +Parameters <code>funcindex</code> and <code>n</code> are as in function <a href="#lua_getupvalue"><code>lua_getupvalue</code></a>, +but <code>n</code> cannot be greater than the number of upvalues. + + @@ -6367,9 +6371,9 @@ pushes nothing and returns <code>LUA_TNIL</code>. <p> Pushes onto the stack the metatable associated with name <code>tname</code> -in the registry (see <a href="#luaL_newmetatable"><code>luaL_newmetatable</code></a>). -If there is no metatable associated with <code>tname</code>, -returns false and pushes <b>nil</b>. +in the registry (see <a href="#luaL_newmetatable"><code>luaL_newmetatable</code></a>) +(<b>nil</b> if there is no metatable associated with that name). +Returns the type of the pushed value. @@ -7333,7 +7337,7 @@ you can use <code>next(t)</code> to check whether a table is empty. <p> The order in which the indices are enumerated is not specified, <em>even for numeric indices</em>. -(To traverse a table in numeric order, +(To traverse a table in numerical order, use a numerical <b>for</b>.) @@ -7522,8 +7526,6 @@ the function returns <b>nil</b>. <hr><h3><a name="pdf-tostring"><code>tostring (v)</code></a></h3> Receives a value of any type and converts it to a string in a human-readable format. -Floats always produce strings with some -floating-point indication (either a decimal dot or an exponent). (For complete control of how numbers are converted, use <a href="#pdf-string.format"><code>string.format</code></a>.) @@ -7579,8 +7581,8 @@ except that it sets a new message handler <code>msgh</code>. <h2>6.2 – <a name="6.2">Coroutine Manipulation</a></h2> <p> -The operations related to coroutines comprise a sub-library of -the basic library and come inside the table <a name="pdf-coroutine"><code>coroutine</code></a>. +This library comprises the operations to manipulate coroutines, +which come inside the table <a name="pdf-coroutine"><code>coroutine</code></a>. See <a href="#2.6">§2.6</a> for a general description of coroutines. @@ -7590,7 +7592,7 @@ See <a href="#2.6">§2.6</a> for a general description of coroutines. <p> Creates a new coroutine, with body <code>f</code>. -<code>f</code> must be a Lua function. +<code>f</code> must be a function. Returns this new coroutine, an object with type <code>"thread"</code>. @@ -7674,7 +7676,7 @@ or if it has stopped with an error. <p> Creates a new coroutine, with body <code>f</code>. -<code>f</code> must be a Lua function. +<code>f</code> must be a function. Returns a function that resumes the coroutine each time it is called. Any arguments passed to the function behave as the extra arguments to <code>resume</code>. @@ -8073,7 +8075,7 @@ The string library assumes one-byte character encodings. <p> <hr><h3><a name="pdf-string.byte"><code>string.byte (s [, i [, j]])</code></a></h3> -Returns the internal numerical codes of the characters <code>s[i]</code>, +Returns the internal numeric codes of the characters <code>s[i]</code>, <code>s[i+1]</code>, ..., <code>s[j]</code>. The default value for <code>i</code> is 1; the default value for <code>j</code> is <code>i</code>. @@ -8082,7 +8084,7 @@ following the same rules of function <a href="#pdf-string.sub"><code>string.sub< <p> -Numerical codes are not necessarily portable across platforms. +Numeric codes are not necessarily portable across platforms. @@ -8091,12 +8093,12 @@ Numerical codes are not necessarily portable across platforms. <hr><h3><a name="pdf-string.char"><code>string.char (···)</code></a></h3> Receives zero or more integers. Returns a string with length equal to the number of arguments, -in which each character has the internal numerical code equal +in which each character has the internal numeric code equal to its corresponding argument. <p> -Numerical codes are not necessarily portable across platforms. +Numeric codes are not necessarily portable across platforms. @@ -8112,9 +8114,9 @@ of the given function, so that a later <a href="#pdf-load"><code>load</code></a> on this string returns a copy of the function (but with new upvalues). If <code>strip</code> is a true value, -the binary representation is created without debug information -about the function -(local variable names, lines, etc.). +the binary representation may not include all debug information +about the function, +to save space. <p> @@ -8138,7 +8140,7 @@ Looks for the first match of If it finds a match, then <code>find</code> returns the indices of <code>s</code> where this occurrence starts and ends; otherwise, it returns <b>nil</b>. -A third, optional numerical argument <code>init</code> specifies +A third, optional numeric argument <code>init</code> specifies where to start the search; its default value is 1 and can be negative. A value of <b>true</b> as a fourth, optional argument <code>plain</code> @@ -8186,18 +8188,23 @@ may produce the string: <p> Options -<code>A</code> and <code>a</code> (when available), -<code>E</code>, <code>e</code>, <code>f</code>, +<code>A</code>, <code>a</code>, <code>E</code>, <code>e</code>, <code>f</code>, <code>G</code>, and <code>g</code> all expect a number as argument. Options <code>c</code>, <code>d</code>, <code>i</code>, <code>o</code>, <code>u</code>, <code>X</code>, and <code>x</code> expect an integer. -Option <code>q</code> expects a string; -option <code>s</code> expects a string without embedded zeros. -If the argument to option <code>s</code> is not a string, +Option <code>q</code> expects a string. +Option <code>s</code> expects a string without embedded zeros; +if its argument is not a string, it is converted to one following the same rules of <a href="#pdf-tostring"><code>tostring</code></a>. +<p> +When Lua is compiled with a non-C99 compiler, +options <code>A</code> and <code>a</code> (hexadecimal floats) +do not support any modifier (flags, width, length). + + <p> @@ -8344,7 +8351,7 @@ the captures from the pattern; otherwise it returns <b>nil</b>. If <code>pattern</code> specifies no captures, then the whole match is returned. -A third, optional numerical argument <code>init</code> specifies +A third, optional numeric argument <code>init</code> specifies where to start the search; its default value is 1 and can be negative. @@ -8499,7 +8506,7 @@ represents the character <em>x</em> itself. represents the character <em>x</em>. This is the standard way to escape the magic characters. Any non-alphanumeric character -(including all punctuations, even the non-magical) +(including all punctuation characters, even the non-magical) can be preceded by a '<code>%</code>' when used to represent itself in a pattern. </li> @@ -8904,7 +8911,7 @@ multiple assignment: <code>a2[t],··· = a1[f],···,a1[e]</code>. The default for <code>a2</code> is <code>a1</code>. The destination range can overlap with the source range. -Index <code>f</code> must be positive. +The number of elements to be moved must fit in a Lua integer. @@ -9120,7 +9127,7 @@ that rounds the quotient towards zero. (integer/float) <p> The float value <code>HUGE_VAL</code>, -a value larger than any other numerical value. +a value larger than any other numeric value. @@ -9602,16 +9609,12 @@ reads a numeral and returns it as a float or an integer, following the lexical conventions of Lua. (The numeral may have leading spaces and a sign.) This format always reads the longest input sequence that -is a valid prefix for a number; -if that prefix does not form a valid number +is a valid prefix for a numeral; +if that prefix does not form a valid numeral (e.g., an empty string, "<code>0x</code>", or "<code>3.4e-</code>"), it is discarded and the function returns <b>nil</b>. </li> -<li><b>"<code>i</code>": </b> -reads an integral number and returns it as an integer. -</li> - <li><b>"<code>a</code>": </b> reads the whole file, starting at the current position. On end of file, it returns the empty string. @@ -9946,17 +9949,26 @@ because of its reliance on C function <code>setlocale</code>. <p> Returns the current time when called without arguments, -or a time representing the date and time specified by the given table. +or a time representing the local date and time specified by the given table. This table must have fields <code>year</code>, <code>month</code>, and <code>day</code>, and may have fields <code>hour</code> (default is 12), <code>min</code> (default is 0), <code>sec</code> (default is 0), and <code>isdst</code> (default is <b>nil</b>). +Other fields are ignored. For a description of these fields, see the <a href="#pdf-os.date"><code>os.date</code></a> function. <p> +The values in these fields do not need to be inside their valid ranges. +For instance, if <code>sec</code> is -10, +it means -10 seconds from the time specified by the other fields; +if <code>hour</code> is 1000, +it means +1000 hours from the time specified by the other fields. + + +<p> The returned value is a number, whose meaning depends on your system. In POSIX, Windows, and some other systems, this number counts the number @@ -10093,7 +10105,7 @@ valid lines. <p> For instance, the expression <code>debug.getinfo(1,"n").name</code> returns -a table with a name for the current function, +a name for the current function, if a reasonable name can be found, and the expression <code>debug.getinfo(print)</code> returns a table with all available information @@ -10599,7 +10611,8 @@ The <code>bit32</code> library has been deprecated. It is easy to require a compatible external library or, better yet, to replace its functions with appropriate bitwise operations. (Keep in mind that <code>bit32</code> operates on 32-bit integers, -while the bitwise operators in standard Lua operate on 64-bit integers.) +while the bitwise operators in Lua 5.3 operate on Lua integers, +which by default have 64 bits.) </li> <li> @@ -10614,7 +10627,7 @@ its <code>__ipairs</code> metamethod has been deprecated. <li> Option names in <a href="#pdf-io.read"><code>io.read</code></a> do not have a starting '<code>*</code>' anymore. -For compatibility, Lua will continue to ignore this character. +For compatibility, Lua will continue to accept (and ignore) this character. </li> <li> @@ -10641,6 +10654,12 @@ if it cannot find an open function according to the new style. but it did not document the change.) </li> +<li> +The call <code>collectgarbage("count")</code> now returns only one result. +(You can compute that second result from the fractional part +of the first result.) +</li> + </ul> @@ -10776,13 +10795,12 @@ and LiteralString, see <a href="#3.1">§3.1</a>.) -<HR> -<SMALL CLASS="footer"> +<P CLASS="footer"> Last update: -Tue Jan 6 10:10:50 BRST 2015 -</SMALL> +Wed Jun 10 18:31:15 BRT 2015 +</P> <!-- -Last change: revised for Lua 5.3.0 (final) +Last change: revised for Lua 5.3.1 --> </body></html> diff --git a/external/mit/lua/dist/doc/readme.html b/external/mit/lua/dist/doc/readme.html index 01657557013..152246f9178 100644 --- a/external/mit/lua/dist/doc/readme.html +++ b/external/mit/lua/dist/doc/readme.html @@ -7,9 +7,9 @@ <STYLE TYPE="text/css"> blockquote, .display { border: solid #a0a0a0 2px ; + border-radius: 8px ; padding: 1em ; margin: 0px ; - border-radius: 8px ; } .display { @@ -28,13 +28,12 @@ tt, kbd, code { <BODY> -<HR> <H1> -<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua" BORDER=0></A> -Welcome to Lua 5.3.0 +<A HREF="http://www.lua.org/"><IMG SRC="logo.gif" ALT="Lua"></A> +Welcome to Lua 5.3 </H1> -<P> +<DIV CLASS="menubar"> <A HREF="#about">about</A> · <A HREF="#install">installation</A> @@ -44,9 +43,9 @@ Welcome to Lua 5.3.0 <A HREF="#license">license</A> · <A HREF="contents.html">reference manual</A> +</DIV> <H2><A NAME="about">About Lua</A></H2> - <P> Lua is a powerful, fast, lightweight, embeddable scripting language developed by a @@ -76,7 +75,6 @@ which may differ slightly from the distributed in this package. <H2><A NAME="install">Installing Lua</A></H2> - <P> Lua is distributed in <A HREF="http://www.lua.org/ftp/">source</A> @@ -102,7 +100,6 @@ Try also a multi-platform distribution of Lua that includes batteries. <H3>Building Lua</H3> - <P> In most Unix-like platforms, simply do "<KBD>make</KBD>" with a suitable target. Here are the details. @@ -110,7 +107,7 @@ Here are the details. <OL> <LI> Open a terminal window and move to -the top-level directory, which is named <TT>lua-5.3.0</TT>. +the top-level directory, which is named <TT>lua-5.3.x</TT>. The <TT>Makefile</TT> there controls both the build process and the installation process. <P> <LI> @@ -140,7 +137,8 @@ and liblua.a (the library). </OL> <P> If you're running Linux and get compilation errors, -make sure you have installed the <TT>readline</TT> development package. +make sure you have installed the <TT>readline</TT> development package +(which is probably named <TT>libreadline-dev</TT> or <TT>readline-devel</TT>). If you get link errors after that, then try "<KBD>make linux MYLIBS=-ltermcap</KBD>". @@ -174,7 +172,7 @@ then try "<KBD>make linux MYLIBS=-ltermcap</KBD>". <DT> include: <DD> - lauxlib.h lua.h lua.hpp luaconf.h lualib.h + lua.h luaconf.h lualib.h lauxlib.h lua.hpp <DT> lib: <DD> @@ -215,7 +213,6 @@ then try "<KBD>make linux MYLIBS=-ltermcap</KBD>". Further customization is available to experts by editing the Lua sources. <H3><A NAME="other">Building Lua on other systems</A></H3> - <P> If you're not using the usual Unix tools, then the instructions for building Lua depend on the compiler you use. You'll need to create @@ -258,7 +255,6 @@ compiler: some features before building Lua. <H2><A NAME="changes">Changes since Lua 5.2</A></H2> - <P> Here are the main changes introduced in Lua 5.3. The @@ -315,11 +311,10 @@ Here are the other changes introduced in Lua 5.3: </UL> <H2><A NAME="license">License</A></H2> +<P> <A HREF="http://www.opensource.org/docs/definition.php"> -<IMG SRC="osi-certified-72x60.png" ALIGN="right" BORDER="0" ALT="[osi certified]" STYLE="padding-left: 30px ;"> +<IMG SRC="osi-certified-72x60.png" ALIGN="right" ALT="[osi certified]" STYLE="padding-left: 30px ;"> </A> - -<P> Lua is free software distributed under the terms of the <A HREF="http://www.opensource.org/licenses/mit-license.html">MIT license</A> reproduced below; @@ -358,13 +353,12 @@ THE SOFTWARE. </BLOCKQUOTE> <P> -<HR> -<SMALL CLASS="footer"> +<P CLASS="footer"> Last update: -Fri Dec 12 09:58:42 BRST 2014 -</SMALL> +Mon Jun 1 21:48:24 BRT 2015 +</P> <!-- -Last change: updated for Lua 5.3.0 (final) +Last change: revised for Lua 5.3.1 --> </BODY> |
