summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/contents.html68
-rw-r--r--doc/lua.css5
-rw-r--r--doc/manual.css13
-rw-r--r--doc/manual.html126
-rw-r--r--doc/readme.html91
5 files changed, 230 insertions, 73 deletions
diff --git a/doc/contents.html b/doc/contents.html
index beba089f..66d967e3 100644
--- a/doc/contents.html
+++ b/doc/contents.html
@@ -32,7 +32,7 @@ For a complete introduction to Lua programming, see the book
<A HREF="#index">index</A>
<HR>
<SMALL>
-Copyright &copy; 2006-2010 Lua.org, PUC-Rio.
+Copyright &copy; 2010 Lua.org, PUC-Rio.
Freely available under the terms of the
<a href="http://www.lua.org/license.html#5">Lua license</a>.
</SMALL>
@@ -59,6 +59,7 @@ Freely available under the terms of the
<LI><A HREF="manual.html#2.4.5">2.4.5 - For Statement</A>
<LI><A HREF="manual.html#2.4.6">2.4.6 - Function Calls as Statements</A>
<LI><A HREF="manual.html#2.4.7">2.4.7 - Local Declarations</A>
+<LI><A HREF="manual.html#2.4.8">2.4.8 - Lexical Environments</A>
</UL>
<LI><A HREF="manual.html#2.5">2.5 - Expressions</A>
<UL>
@@ -92,8 +93,9 @@ Freely available under the terms of the
<LI><A HREF="manual.html#3.4">3.4 - C Closures</A>
<LI><A HREF="manual.html#3.5">3.5 - Registry</A>
<LI><A HREF="manual.html#3.6">3.6 - Error Handling in C</A>
-<LI><A HREF="manual.html#3.7">3.7 - Functions and Types</A>
-<LI><A HREF="manual.html#3.8">3.8 - The Debug Interface</A>
+<LI><A HREF="manual.html#3.7">3.7 - Handling Yields in C</A>
+<LI><A HREF="manual.html#3.8">3.8 - Functions and Types</A>
+<LI><A HREF="manual.html#3.9">3.9 - The Debug Interface</A>
</UL>
<P>
<LI><A HREF="manual.html#4">4 - The Auxiliary Library</A>
@@ -112,9 +114,10 @@ Freely available under the terms of the
</UL>
<LI><A HREF="manual.html#5.5">5.5 - Table Manipulation</A>
<LI><A HREF="manual.html#5.6">5.6 - Mathematical Functions</A>
-<LI><A HREF="manual.html#5.7">5.7 - Input and Output Facilities</A>
-<LI><A HREF="manual.html#5.8">5.8 - Operating System Facilities</A>
-<LI><A HREF="manual.html#5.9">5.9 - The Debug Library</A>
+<LI><A HREF="manual.html#5.7">5.7 - Bitwise operations</A>
+<LI><A HREF="manual.html#5.8">5.8 - Input and Output Facilities</A>
+<LI><A HREF="manual.html#5.9">5.9 - Operating System Facilities</A>
+<LI><A HREF="manual.html#5.10">5.10 - The Debug Library</A>
</UL>
<P>
<LI><A HREF="manual.html#6">6 - Lua Stand-alone</A>
@@ -140,10 +143,10 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-collectgarbage">collectgarbage</A><BR>
<A HREF="manual.html#pdf-dofile">dofile</A><BR>
<A HREF="manual.html#pdf-error">error</A><BR>
-<A HREF="manual.html#pdf-getfenv">getfenv</A><BR>
<A HREF="manual.html#pdf-getmetatable">getmetatable</A><BR>
<A HREF="manual.html#pdf-ipairs">ipairs</A><BR>
<A HREF="manual.html#pdf-load">load</A><BR>
+<A HREF="manual.html#pdf-loadin">loadin</A><BR>
<A HREF="manual.html#pdf-loadfile">loadfile</A><BR>
<A HREF="manual.html#pdf-loadstring">loadstring</A><BR>
<A HREF="manual.html#pdf-module">module</A><BR>
@@ -156,15 +159,22 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-rawset">rawset</A><BR>
<A HREF="manual.html#pdf-require">require</A><BR>
<A HREF="manual.html#pdf-select">select</A><BR>
-<A HREF="manual.html#pdf-setfenv">setfenv</A><BR>
<A HREF="manual.html#pdf-setmetatable">setmetatable</A><BR>
<A HREF="manual.html#pdf-tonumber">tonumber</A><BR>
<A HREF="manual.html#pdf-tostring">tostring</A><BR>
<A HREF="manual.html#pdf-type">type</A><BR>
-<A HREF="manual.html#pdf-unpack">unpack</A><BR>
<A HREF="manual.html#pdf-xpcall">xpcall</A><BR>
<P>
+<A HREF="manual.html#pdf-bit.band">bit.band</A><BR>
+<A HREF="manual.html#pdf-bit.bnot">bit.bnot</A><BR>
+<A HREF="manual.html#pdf-bit.bor">bit.bor</A><BR>
+<A HREF="manual.html#pdf-bit.brotate">bit.brotate</A><BR>
+<A HREF="manual.html#pdf-bit.bshift">bit.bshift</A><BR>
+<A HREF="manual.html#pdf-bit.btest">bit.btest</A><BR>
+<A HREF="manual.html#pdf-bit.bxor">bit.bxor</A><BR>
+<P>
+
<A HREF="manual.html#pdf-coroutine.create">coroutine.create</A><BR>
<A HREF="manual.html#pdf-coroutine.resume">coroutine.resume</A><BR>
<A HREF="manual.html#pdf-coroutine.running">coroutine.running</A><BR>
@@ -187,6 +197,8 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-debug.setmetatable">debug.setmetatable</A><BR>
<A HREF="manual.html#pdf-debug.setupvalue">debug.setupvalue</A><BR>
<A HREF="manual.html#pdf-debug.traceback">debug.traceback</A><BR>
+<A HREF="manual.html#pdf-debug.upvalueid">debug.upvalueid</A><BR>
+<A HREF="manual.html#pdf-debug.upvaluejoin">debug.upvaluejoin</A><BR>
</TD>
<TD>
@@ -232,7 +244,6 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-math.huge">math.huge</A><BR>
<A HREF="manual.html#pdf-math.ldexp">math.ldexp</A><BR>
<A HREF="manual.html#pdf-math.log">math.log</A><BR>
-<A HREF="manual.html#pdf-math.log10">math.log10</A><BR>
<A HREF="manual.html#pdf-math.max">math.max</A><BR>
<A HREF="manual.html#pdf-math.min">math.min</A><BR>
<A HREF="manual.html#pdf-math.modf">math.modf</A><BR>
@@ -261,12 +272,14 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-os.tmpname">os.tmpname</A><BR>
<P>
+<A HREF="manual.html#pdf-package.config">package.config</A><BR>
<A HREF="manual.html#pdf-package.cpath">package.cpath</A><BR>
<A HREF="manual.html#pdf-package.loaded">package.loaded</A><BR>
<A HREF="manual.html#pdf-package.loaders">package.loaders</A><BR>
<A HREF="manual.html#pdf-package.loadlib">package.loadlib</A><BR>
<A HREF="manual.html#pdf-package.path">package.path</A><BR>
<A HREF="manual.html#pdf-package.preload">package.preload</A><BR>
+<A HREF="manual.html#pdf-package.searchpath">package.searchpath</A><BR>
<A HREF="manual.html#pdf-package.seeall">package.seeall</A><BR>
<P>
@@ -288,9 +301,10 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-table.concat">table.concat</A><BR>
<A HREF="manual.html#pdf-table.insert">table.insert</A><BR>
-<A HREF="manual.html#pdf-table.maxn">table.maxn</A><BR>
+<A HREF="manual.html#pdf-table.pack">table.pack</A><BR>
<A HREF="manual.html#pdf-table.remove">table.remove</A><BR>
<A HREF="manual.html#pdf-table.sort">table.sort</A><BR>
+<A HREF="manual.html#pdf-table.unpack">table.unpack</A><BR>
</TD>
<TD>
@@ -308,21 +322,23 @@ Freely available under the terms of the
<A HREF="manual.html#lua_atpanic">lua_atpanic</A><BR>
<A HREF="manual.html#lua_call">lua_call</A><BR>
+<A HREF="manual.html#lua_callk">lua_callk</A><BR>
<A HREF="manual.html#lua_checkstack">lua_checkstack</A><BR>
<A HREF="manual.html#lua_close">lua_close</A><BR>
+<A HREF="manual.html#lua_compare">lua_compare</A><BR>
<A HREF="manual.html#lua_concat">lua_concat</A><BR>
-<A HREF="manual.html#lua_cpcall">lua_cpcall</A><BR>
+<A HREF="manual.html#lua_copy">lua_copy</A><BR>
<A HREF="manual.html#lua_createtable">lua_createtable</A><BR>
<A HREF="manual.html#lua_dump">lua_dump</A><BR>
-<A HREF="manual.html#lua_equal">lua_equal</A><BR>
<A HREF="manual.html#lua_error">lua_error</A><BR>
<A HREF="manual.html#lua_gc">lua_gc</A><BR>
<A HREF="manual.html#lua_getallocf">lua_getallocf</A><BR>
+<A HREF="manual.html#lua_getctx">lua_getctx</A><BR>
<A HREF="manual.html#lua_getfenv">lua_getfenv</A><BR>
<A HREF="manual.html#lua_getfield">lua_getfield</A><BR>
<A HREF="manual.html#lua_getglobal">lua_getglobal</A><BR>
-<A HREF="manual.html#lua_gethook">lua_gethook</A><BR>
<A HREF="manual.html#lua_gethookcount">lua_gethookcount</A><BR>
+<A HREF="manual.html#lua_gethook">lua_gethook</A><BR>
<A HREF="manual.html#lua_gethookmask">lua_gethookmask</A><BR>
<A HREF="manual.html#lua_getinfo">lua_getinfo</A><BR>
<A HREF="manual.html#lua_getlocal">lua_getlocal</A><BR>
@@ -344,15 +360,15 @@ Freely available under the terms of the
<A HREF="manual.html#lua_istable">lua_istable</A><BR>
<A HREF="manual.html#lua_isthread">lua_isthread</A><BR>
<A HREF="manual.html#lua_isuserdata">lua_isuserdata</A><BR>
-<A HREF="manual.html#lua_lessthan">lua_lessthan</A><BR>
+<A HREF="manual.html#lua_len">lua_len</A><BR>
<A HREF="manual.html#lua_load">lua_load</A><BR>
<A HREF="manual.html#lua_newstate">lua_newstate</A><BR>
<A HREF="manual.html#lua_newtable">lua_newtable</A><BR>
<A HREF="manual.html#lua_newthread">lua_newthread</A><BR>
<A HREF="manual.html#lua_newuserdata">lua_newuserdata</A><BR>
<A HREF="manual.html#lua_next">lua_next</A><BR>
-<A HREF="manual.html#lua_objlen">lua_objlen</A><BR>
<A HREF="manual.html#lua_pcall">lua_pcall</A><BR>
+<A HREF="manual.html#lua_pcallk">lua_pcallk</A><BR>
<A HREF="manual.html#lua_pop">lua_pop</A><BR>
<A HREF="manual.html#lua_pushboolean">lua_pushboolean</A><BR>
<A HREF="manual.html#lua_pushcclosure">lua_pushcclosure</A><BR>
@@ -369,10 +385,11 @@ Freely available under the terms of the
<A HREF="manual.html#lua_pushvalue">lua_pushvalue</A><BR>
<A HREF="manual.html#lua_pushvfstring">lua_pushvfstring</A><BR>
<A HREF="manual.html#lua_rawequal">lua_rawequal</A><BR>
-<A HREF="manual.html#lua_rawget">lua_rawget</A><BR>
<A HREF="manual.html#lua_rawgeti">lua_rawgeti</A><BR>
-<A HREF="manual.html#lua_rawset">lua_rawset</A><BR>
+<A HREF="manual.html#lua_rawget">lua_rawget</A><BR>
+<A HREF="manual.html#lua_rawlen">lua_rawlen</A><BR>
<A HREF="manual.html#lua_rawseti">lua_rawseti</A><BR>
+<A HREF="manual.html#lua_rawset">lua_rawset</A><BR>
<A HREF="manual.html#lua_register">lua_register</A><BR>
<A HREF="manual.html#lua_remove">lua_remove</A><BR>
<A HREF="manual.html#lua_replace">lua_replace</A><BR>
@@ -399,9 +416,13 @@ Freely available under the terms of the
<A HREF="manual.html#lua_touserdata">lua_touserdata</A><BR>
<A HREF="manual.html#lua_type">lua_type</A><BR>
<A HREF="manual.html#lua_typename">lua_typename</A><BR>
+<A HREF="manual.html#lua_upvalueid">lua_upvalueid</A><BR>
<A HREF="manual.html#lua_upvalueindex">lua_upvalueindex</A><BR>
+<A HREF="manual.html#lua_upvaluejoin">lua_upvaluejoin</A><BR>
+<A HREF="manual.html#lua_version">lua_version</A><BR>
<A HREF="manual.html#lua_xmove">lua_xmove</A><BR>
<A HREF="manual.html#lua_yield">lua_yield</A><BR>
+<A HREF="manual.html#lua_yieldk">lua_yieldk</A><BR>
</TD>
<TD>
@@ -430,12 +451,14 @@ Freely available under the terms of the
<A HREF="manual.html#luaL_checkstring">luaL_checkstring</A><BR>
<A HREF="manual.html#luaL_checktype">luaL_checktype</A><BR>
<A HREF="manual.html#luaL_checkudata">luaL_checkudata</A><BR>
+<A HREF="manual.html#luaL_checkversion">luaL_checkversion</A><BR>
<A HREF="manual.html#luaL_dofile">luaL_dofile</A><BR>
<A HREF="manual.html#luaL_dostring">luaL_dostring</A><BR>
<A HREF="manual.html#luaL_error">luaL_error</A><BR>
<A HREF="manual.html#luaL_getmetafield">luaL_getmetafield</A><BR>
<A HREF="manual.html#luaL_getmetatable">luaL_getmetatable</A><BR>
<A HREF="manual.html#luaL_gsub">luaL_gsub</A><BR>
+<A HREF="manual.html#luaL_len">luaL_len</A><BR>
<A HREF="manual.html#luaL_loadbuffer">luaL_loadbuffer</A><BR>
<A HREF="manual.html#luaL_loadfile">luaL_loadfile</A><BR>
<A HREF="manual.html#luaL_loadstring">luaL_loadstring</A><BR>
@@ -452,8 +475,11 @@ Freely available under the terms of the
<A HREF="manual.html#luaL_pushresult">luaL_pushresult</A><BR>
<A HREF="manual.html#luaL_ref">luaL_ref</A><BR>
<A HREF="manual.html#luaL_register">luaL_register</A><BR>
+<A HREF="manual.html#luaL_testudata">luaL_testudata</A><BR>
+<A HREF="manual.html#luaL_tolstring">luaL_tolstring</A><BR>
+<A HREF="manual.html#luaL_traceback">luaL_traceback</A><BR>
+<A HREF="manual.html#luaL_typeerror">luaL_typeerror</A><BR>
<A HREF="manual.html#luaL_typename">luaL_typename</A><BR>
-<A HREF="manual.html#luaL_typerror">luaL_typerror</A><BR>
<A HREF="manual.html#luaL_unref">luaL_unref</A><BR>
<A HREF="manual.html#luaL_where">luaL_where</A><BR>
@@ -465,10 +491,10 @@ Freely available under the terms of the
<HR>
<SMALL>
Last update:
-Fri Jan 8 16:29:00 BRST 2010
+Wed Jan 13 15:31:47 BRST 2010
</SMALL>
<!--
-Last change: fake for Lua 5.2.0-work1
+Last change: revised for Lua 5.2.0 (work2)
-->
</BODY>
diff --git a/doc/lua.css b/doc/lua.css
index 039cf116..40041a47 100644
--- a/doc/lua.css
+++ b/doc/lua.css
@@ -39,3 +39,8 @@ hr {
background-color: #a0a0a0 ;
}
+:target {
+ background-color: #F8F8F8 ;
+ padding: 8px ;
+ border: solid #a0a0a0 2px ;
+}
diff --git a/doc/manual.css b/doc/manual.css
new file mode 100644
index 00000000..eed5afd9
--- /dev/null
+++ b/doc/manual.css
@@ -0,0 +1,13 @@
+h3 code {
+ font-family: inherit ;
+}
+
+pre {
+ font-size: 105% ;
+}
+
+span.apii {
+ float: right ;
+ font-family: inherit ;
+}
+
diff --git a/doc/manual.html b/doc/manual.html
index 83d2bb09..6ebd0740 100644
--- a/doc/manual.html
+++ b/doc/manual.html
@@ -1,31 +1,39 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Lua 5.2 Reference Manual</title>
-<link rel="stylesheet" href="lua.css">
+<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>
-<body bgcolor="#FFFFFF">
+<body>
<hr>
<h1>
-<a href="http://www.lua.org/home.html"><img src="logo.gif" alt="[Lua logo]" border="0"></a>
+<a href="http://www.lua.org/"><img src="logo.gif" alt="" border="0"></a>
Lua 5.2 Reference Manual
</h1>
by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes
<p>
<small>
-<a href="http://www.lua.org/copyright.html">Copyright</a>
-&copy; 2010 Lua.org, PUC-Rio. All rights reserved.
+Copyright &copy; 2010 Lua.org, PUC-Rio.
+Freely available under the terms of the
+<a href="http://www.lua.org/license.html#5">Lua license</a>.
</small>
<hr>
+<p>
+
+<a href="contents.html#contents">contents</A>
+&middot;
+<a href="contents.html#index">index</A>
<!-- ====================================================================== -->
<p>
-<!-- $Id: manual.of,v 1.53 2010/01/08 18:18:46 roberto Exp roberto $ -->
+<!-- $Id: manual.of,v 1.54 2010/01/13 16:50:58 roberto Exp roberto $ -->
@@ -166,10 +174,12 @@ and can contain the following C-like escape sequences:
and '<code>\'</code>' (apostrophe [single quote]).
Moreover, a backslash followed by a real newline
results in a newline in the string.
-A character in a string can also be specified by its numerical value
-using the escape sequence <code>\<em>ddd</em></code>,
+A character in a string can also be specified by its numerical 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,
+and with the escape sequence <code>\<em>ddd</em></code>,
where <em>ddd</em> is a sequence of up to three decimal digits.
-(Note that if a numerical escape is to be followed by a digit,
+(Note that if a decimal escape is to be followed by a digit,
it must be expressed using exactly three digits.)
Strings in Lua can contain any 8-bit value, including embedded zeros,
which can be specified as '<code>\0</code>'.
@@ -2053,7 +2063,8 @@ the speed of memory allocation.
<p>
If you set the step multiplier to a very large number
-(such as <em>2^30</em>),
+(larger than 10% of the maximum number of
+bytes that the program may use),
the collector behaves like a stop-the-world collector.
If you then set the pause to 200,
the collector behaves as in old Lua versions,
@@ -5104,6 +5115,15 @@ will return identical ids for those upvalue indices.
+<hr><h3><a name="lua_upvaluejoin"><code>lua_upvaluejoin</code></a></h3>
+<pre>void lua_upvaluejoin (lua_State *L, int fidx1, int n1,
+ int fidx2, int n2);</pre><p>
+TO BE DONE!!
+
+
+
+
+
<h1>4 - <a name="4">The Auxiliary Library</a></h1>
@@ -6000,10 +6020,33 @@ it returns <code>NULL</code> instead of throwing an error.
+<hr><h3><a name="luaL_tolstring"><code>luaL_tolstring</code></a></h3><p>
+<span class="apii">[-0, +1, <em>e</em>]</span>
+<pre>const char *luaL_tolstring (lua_State *L, int idx, size_t *len);</pre>
+
+<p>
+Converts any Lua value at the given acceptable index to a C&nbsp;string
+in a reasonable format.
+The resulting string is pushed onto the stack and also
+returned by the function.
+If <code>len</code> is not <code>NULL</code>,
+the function also sets <code>*len</code> with the string length.
+
+
+<p>
+If the value has a metatable with a <code>"__tostring"</code> field,
+then <code>luaL_tolstring</code> calls the corresponding metamethod
+with the value as argument,
+and uses the result of the call as its result.
+
+
+
+
+
<hr><h3><a name="luaL_traceback"><code>luaL_traceback</code></a></h3><p>
<span class="apii">[-0, +1, <em>m</em>]</span>
-<pre>luaL_traceback (lua_State *L, lua_State *L1,
- const char *msg, int level);</pre>
+<pre>void luaL_traceback (lua_State *L, lua_State *L1,
+ const char *msg, int level);</pre>
<p>
Creates and pushes a traceback of the stack <code>L1</code>.
@@ -7111,22 +7154,23 @@ A path is string containing a sequence of
<em>templates</em> separated by semicolons.
For each template,
the function changes each interrogation
-mark in the template by <code>name</code>,
+mark in the template by a copy of <code>name</code>
+wherein all dots were replaced by the system's directory separator,
and then tries to open the resulting file name.
For instance, if the path is the string
<pre>
"./?.lua;./?.lc;/usr/local/?/init.lua"
</pre><p>
-the search for name <code>foo</code>
+the search for the name <code>foo.a</code>
will try to open the files
-<code>./foo.lua</code>, <code>./foo.lc</code>, and
-<code>/usr/local/foo/init.lua</code>, in that order.
+<code>./foo/a.lua</code>, <code>./foo/a.lc</code>, and
+<code>/usr/local/foo/a/init.lua</code>, in that order.
<p>
Returns the resulting name of the first file that it can
-open in read mode (after closing it),
+open in read mode (after closing the file),
or <b>nil</b> plus an error message if none succeeds.
(This error message lists all file names it tried to open.)
@@ -7950,7 +7994,7 @@ Returns <em>m2<sup>e</sup></em> (<code>e</code> should be an integer).
<p>
Returns the logarithm of <code>x</code> in the given base.
-The default for <code>base</code> is $e$
+The default for <code>base</code> is <em>e</em>
(so that the function returns the natural logarithm of <code>x</code>).
@@ -9140,6 +9184,36 @@ to start the traceback
+<p>
+<hr><h3><a name="pdf-debug.upvalueid"><code>debug.upvalueid (function, n)</code></a></h3>
+
+
+<p>
+Returns an unique identifier (as a light userdata)
+for the upvalue numbered <code>n</code>
+from the given function.
+
+
+<p>
+These unique identifiers allow a program to check whether different
+closures share upvalues.
+Lua closures that share an upvalue
+(that is, that access a same external local variable)
+will return identical ids for those upvalue indices.
+
+
+
+
+<p>
+<hr><h3><a name="pdf-debug.upvaluejoin"><code>debug.upvaluejoin ()</code></a></h3>
+
+
+<p>
+TO BE DONE!!
+
+
+
+
@@ -9319,7 +9393,7 @@ Weak tables with weak keys now perform like <em>ephemeron tables</em>.
<li>
Threads do not have individual environments.
-All threads share a sinle fixed environment.
+All threads share a single fixed environment.
</li>
</ul>
@@ -9367,7 +9441,7 @@ and therefore must be called as <a href="#pdf-table.unpack"><code>table.unpack</
<ul>
<li>
-Pseudoindex <code>LUA_GLOBALSINDEX</code> was deprecated.
+Pseudoindex <code>LUA_GLOBALSINDEX</code> was removed.
You may use the pseudoindex <a href="#pdf-LUA_ENVIRONINDEX"><code>LUA_ENVIRONINDEX</code></a> instead,
if the C&nbsp;function does not change its standard environment.
Otherwise, you should get the global environment from the registry
@@ -9484,5 +9558,15 @@ Here is the complete syntax of Lua in extended BNF.
+
+<HR>
+<SMALL>
+Last update:
+Wed Jan 13 15:29:29 BRST 2010
+</SMALL>
+<!--
+Last change: revised for Lua 5.2.0 (work2)
+-->
+
</body></html>
diff --git a/doc/readme.html b/doc/readme.html
index 7640d3af..6d9e601e 100644
--- a/doc/readme.html
+++ b/doc/readme.html
@@ -21,6 +21,13 @@ blockquote, .display {
padding-right: 15px;
background: transparent url(external.png) no-repeat center right;
}
+
+tt, kbd {
+ font-size: 120% ;
+ xcolor: black ;
+ xpadding: 4px ;
+ xbackground-color: #E0E0E0 ;
+}
</STYLE>
</HEAD>
@@ -80,7 +87,6 @@ distributed in this package.
<P>
<H2><A NAME="install">Installing Lua</A></H2>
-<DIV CLASS="review">how much detail?</DIV><P>
Lua is distributed in source form.
You need to build it before using it.
@@ -100,7 +106,7 @@ See below for
<H3>Building Lua</H3>
-In most Unix-like platforms, simply do "make" with a suitable target.
+In most Unix-like platforms, simply do "<KBD>make</KBD>" with a suitable target.
Here are the details.
<P>
@@ -111,13 +117,13 @@ the top-level directory, which is named lua-5.2.
The Makefile there controls both the build process and the installation process.
<P>
<LI>
- Do "make" and see if your platform is listed.
+ Do "<KBD>make</KBD>" and see if your platform is listed.
The platforms currently supported are:
<BLOCKQUOTE>
aix ansi bsd freebsd generic linux macosx mingw posix solaris
</BLOCKQUOTE>
<P>
- If your platform is listed, just do "make xxx", where xxx
+ If your platform is listed, just do "<KBD>make xxx</KBD>", where xxx
is your platform name.
<P>
If your platform is not listed, try the closest one or posix, generic,
@@ -131,7 +137,7 @@ luac (the compiler),
and liblua.a (the library).
<P>
<LI>
- If you want to check that Lua has been built correctly, do "make test"
+ If you want to check that Lua has been built correctly, do "<KBD>make test</KBD>"
after building Lua. This will run the interpreter on a "hello world"
Lua program from the test directory.
You may want to try other example programs in that directory.
@@ -140,19 +146,19 @@ and liblua.a (the library).
<H3>Installing Lua</H3>
Once you have built Lua, you may want to install it in an official
- place in your system. In this case, do "make install". The official
+ place in your system. In this case, do "<KBD>make install</KBD>". The official
place and the way to install files are defined in Makefile. You'll
probably need the right permissions to install files.
<P>
- If you want to build and install Lua in one step, do <SPAN CLASS="display">"make xxx install"</SPAN>,
+ If you want to build and install Lua in one step, do "<KBD>make xxx install</KBD>",
where xxx is your platform name.
<P>
- If you want to install Lua locally, then do "make local". This will
- create directories bin, include, lib, man, and install Lua there as
- follows:
- <SPAN CLASS="review">review!</SPAN>
+ If you want to install Lua locally, then do "<KBD>make local</KBD>".
+ This will create a directory <TT>install</TT> with subdirectories
+ <TT>bin</TT>, <TT>include</TT>, <TT>lib</TT>, <TT>man</TT>,
+ and install Lua there as follows:
<P>
<DL CLASS="display">
@@ -185,15 +191,15 @@ and liblua.a (the library).
<P>
If you want to install Lua locally, but in some other directory, do
- "make install INSTALL_TOP=xxx", where xxx is your chosen directory.
+ "<KBD>make install INSTALL_TOP=xxx</KBD>", where xxx is your chosen directory.
<P>
<H3><A NAME="customization">Customization</A></H3>
Three kinds of things can be customized by editing a file:
<UL>
- <LI> Where and how to install Lua &ndash; edit Makefile.
- <LI> How to build Lua &ndash; edit src/Makefile.
- <LI> Lua features &ndash; edit src/luaconf.h.
+ <LI> Where and how to install Lua &mdash; edit Makefile.
+ <LI> How to build Lua &mdash; edit src/Makefile.
+ <LI> Lua features &mdash; edit src/luaconf.h.
</UL>
<P>
@@ -205,6 +211,7 @@ and liblua.a (the library).
to edit src/luaconf.h before building and installing Lua.
The edited file will be the one installed, and
it will be used by any Lua clients that you build, to ensure consistency.
+ (Further customization is possible by editing the Lua sources.)
<P>
We strongly recommend that you enable dynamic loading. This is done
@@ -223,11 +230,11 @@ and liblua.a (the library).
<DT>
library:
<DD>
- lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c
- lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c
- ltable.c ltm.c lundump.c lvm.c lzio.c
- lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c loslib.c
- ltablib.c lstrlib.c loadlib.c linit.c
+lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c
+lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c
+ltm.c lundump.c lvm.c lzio.c
+lauxlib.c lbaselib.c lbitlib.c ldblib.c liolib.c lmathlib.c loslib.c
+ltablib.c lstrlib.c loadlib.c linit.c
<DT>
interpreter:
<DD>
@@ -238,12 +245,12 @@ compiler:
library, luac.c print.c
</DL>
- If you use Visual Studio .NET, you can use etc/luavs.bat in its
+ If you use Visual Studio .NET, you can use <TT>etc/luavs.bat</TT> in its
"Command Prompt".
<P>
If all you want is to build the Lua interpreter, you may put all .c files
- in a single project, except for luac.c and print.c. Or just use etc/all.c.
+ in a single project, except for luac.c and print.c. Or just use <TT>etc/one.c</TT>.
<P>
To use Lua as a library in your own programs you'll need to know how to
@@ -254,7 +261,7 @@ compiler:
into each dynamic library. For Unix, we recommend that the Lua library
be linked statically into the host program and its symbols exported for
dynamic linking; src/Makefile does this for the Lua interpreter.
- For Windows, we recommend that the Lua library be DLL.
+ For Windows, we recommend that the Lua library be a DLL.
<P>
As mentioned above, you may edit src/luaconf.h to customize
@@ -262,10 +269,9 @@ compiler:
<P>
<H2><A NAME="changes">Changes since Lua 5.1</A></H2>
-<DIV CLASS="review">incomplete!</DIV><P>
Here are the main changes in Lua since its last release.
-The
+The
<A HREF="contents.html">reference manual</A>
lists the
<A HREF="manual.html#7">incompatibilities</A> that had to be introduced.
@@ -274,15 +280,32 @@ lists the
<H3>Language</H3>
<UL>
<LI> new lexical environments.
+<LI> no more fenv for threads.
+<LI> ephemeron tables.
+<LI> yieldable pcall/metamethods.
+<LI> tables honor the <CODE>__len</CODE> metamethod.
+<LI> max constants per function raised to 2^26.
<LI> hex escapes in strings.
-<LI> tables and strings honor the <CODE>__len</CODE> metamethod.
+<LI> no more verification of opcode consistency.
+
</UL>
<H3>Libraries</H3>
<UL>
-<LI> new function <CODE>package.searchpath</CODE>.
+<LI> new library for bitwise operations.
<LI> new metamethods <CODE>__pairs</CODE> and <CODE>__ipairs</CODE>.
<LI> arguments for function called through <CODE>xpcall</CODE>.
+<LI> optional argument to load (to control binary x text).
+<LI> <CODE>loadlib</CODE> may load libraries with global names (RTLD_GLOBAL).
+<LI> new function <CODE>package.searchpath</CODE>.
+<LI> optional base in <CODE>math.log</CODE>.
+<LI> <CODE>file:write</CODE> returns file.
+<LI> closing a pipe returns exit status.
+<LI> <CODE>os.exit</CODE> may close state.
+<LI> new option 'isrunning' for <CODE>collectgarbage</CODE> and <CODE>lua_gc</CODE>.
+<LI> frontier patterns.
+<LI> <CODE>ipairs</CODE> now goes until #t.
+
</UL>
<H3>Implementation</H3>
@@ -291,9 +314,12 @@ lists the
(core forces a full collection when allocation fails).
<LI> ephemeron tables
(tables with weak keys only visit value when key is accessible)
-<LI> handling of non-string error messages.
+<LI> handling of non-string error messages in the standalone interpreter.
<LI> udata with finalizers are kept in a separated list for the GC.
-<SPAN CLASS="review">relevant?</SPAN>
+<LI> CallInfo stack now is a linked list.
+<LI> internal (immutable) version of ctypes.
+<LI> parser uses much less C-stack space (no more auto arrays).
+<LI> new hash for floats.
</UL>
@@ -317,7 +343,7 @@ For details and rationale, see
<P>
<BLOCKQUOTE>
-Copyright &copy; 1994-2010 Lua.org, PUC-Rio.
+Copyright &copy; 1994&ndash;2010 Lua.org, PUC-Rio.
<P>
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -346,8 +372,11 @@ THE SOFTWARE.
<HR>
<SMALL>
Last update:
-Fri Jan 8 16:41:16 BRST 2010
+Wed Jan 13 15:35:05 BRST 2010
</SMALL>
+<!--
+Last change: revised for Lua 5.2.0 (work2)
+-->
</BODY>
</HTML>