Skip to content

Commit 9358cd6

Browse files
committed
Lua 5.2 release.
1 parent 52eff16 commit 9358cd6

File tree

10 files changed

+1501
-539
lines changed

10 files changed

+1501
-539
lines changed

doc/contents.html

100755100644
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ <H1>
2020
Lua 5.2 Reference Manual
2121
</H1>
2222

23-
<P>
24-
<IMG SRC="alert.png" ALIGN="absbottom" ALT="[!]">
25-
<EM>This is a beta version of Lua 5.2.
26-
Some details may change in the final version.</EM>
27-
2823
<P>
2924
The reference manual is the official definition of the Lua language.
3025
For a complete introduction to Lua programming, see the book
@@ -95,7 +90,7 @@ <H2><A NAME="contents">Contents</A></H2>
9590
<UL>
9691
<LI><A HREF="manual.html#4.1">4.1 &ndash; The Stack</A>
9792
<LI><A HREF="manual.html#4.2">4.2 &ndash; Stack Size</A>
98-
<LI><A HREF="manual.html#4.3">4.3 &ndash; Pseudo-Indices</A>
93+
<LI><A HREF="manual.html#4.3">4.3 &ndash; Valid and Acceptable Indices</A>
9994
<LI><A HREF="manual.html#4.4">4.4 &ndash; C Closures</A>
10095
<LI><A HREF="manual.html#4.5">4.5 &ndash; Registry</A>
10196
<LI><A HREF="manual.html#4.6">4.6 &ndash; Error Handling in C</A>
@@ -154,8 +149,8 @@ <H3><A NAME="functions">Lua functions</A></H3>
154149
<A HREF="manual.html#pdf-error">error</A><BR>
155150
<A HREF="manual.html#pdf-getmetatable">getmetatable</A><BR>
156151
<A HREF="manual.html#pdf-ipairs">ipairs</A><BR>
157-
<A HREF="manual.html#pdf-load">load</A><BR>
158152
<A HREF="manual.html#pdf-loadfile">loadfile</A><BR>
153+
<A HREF="manual.html#pdf-load">load</A><BR>
159154
<A HREF="manual.html#pdf-next">next</A><BR>
160155
<A HREF="manual.html#pdf-pairs">pairs</A><BR>
161156
<A HREF="manual.html#pdf-pcall">pcall</A><BR>
@@ -406,6 +401,8 @@ <H3>C API</H3>
406401
<A HREF="manual.html#lua_rawlen">lua_rawlen</A><BR>
407402
<A HREF="manual.html#lua_rawset">lua_rawset</A><BR>
408403
<A HREF="manual.html#lua_rawseti">lua_rawseti</A><BR>
404+
<A HREF="manual.html#lua_rawgetp">lua_rawgetp</A><BR>
405+
<A HREF="manual.html#lua_rawsetp">lua_rawsetp</A><BR>
409406
<A HREF="manual.html#lua_register">lua_register</A><BR>
410407
<A HREF="manual.html#lua_remove">lua_remove</A><BR>
411408
<A HREF="manual.html#lua_replace">lua_replace</A><BR>
@@ -463,8 +460,8 @@ <H3>auxiliary library</H3>
463460
<A HREF="manual.html#luaL_buffinitsize">luaL_buffinitsize</A><BR>
464461
<A HREF="manual.html#luaL_callmeta">luaL_callmeta</A><BR>
465462
<A HREF="manual.html#luaL_checkany">luaL_checkany</A><BR>
466-
<A HREF="manual.html#luaL_checkint">luaL_checkint</A><BR>
467463
<A HREF="manual.html#luaL_checkinteger">luaL_checkinteger</A><BR>
464+
<A HREF="manual.html#luaL_checkint">luaL_checkint</A><BR>
468465
<A HREF="manual.html#luaL_checklong">luaL_checklong</A><BR>
469466
<A HREF="manual.html#luaL_checklstring">luaL_checklstring</A><BR>
470467
<A HREF="manual.html#luaL_checknumber">luaL_checknumber</A><BR>
@@ -486,15 +483,17 @@ <H3>auxiliary library</H3>
486483
<A HREF="manual.html#luaL_gsub">luaL_gsub</A><BR>
487484
<A HREF="manual.html#luaL_len">luaL_len</A><BR>
488485
<A HREF="manual.html#luaL_loadbuffer">luaL_loadbuffer</A><BR>
486+
<A HREF="manual.html#luaL_loadbufferx">luaL_loadbufferx</A><BR>
489487
<A HREF="manual.html#luaL_loadfile">luaL_loadfile</A><BR>
488+
<A HREF="manual.html#luaL_loadfilex">luaL_loadfilex</A><BR>
490489
<A HREF="manual.html#luaL_loadstring">luaL_loadstring</A><BR>
491490
<A HREF="manual.html#luaL_newlib">luaL_newlib</A><BR>
492491
<A HREF="manual.html#luaL_newlibtable">luaL_newlibtable</A><BR>
493492
<A HREF="manual.html#luaL_newmetatable">luaL_newmetatable</A><BR>
494493
<A HREF="manual.html#luaL_newstate">luaL_newstate</A><BR>
495494
<A HREF="manual.html#luaL_openlibs">luaL_openlibs</A><BR>
496-
<A HREF="manual.html#luaL_optint">luaL_optint</A><BR>
497495
<A HREF="manual.html#luaL_optinteger">luaL_optinteger</A><BR>
496+
<A HREF="manual.html#luaL_optint">luaL_optint</A><BR>
498497
<A HREF="manual.html#luaL_optlong">luaL_optlong</A><BR>
499498
<A HREF="manual.html#luaL_optlstring">luaL_optlstring</A><BR>
500499
<A HREF="manual.html#luaL_optnumber">luaL_optnumber</A><BR>
@@ -522,10 +521,10 @@ <H3>auxiliary library</H3>
522521
<HR>
523522
<SMALL CLASS="footer">
524523
Last update:
525-
Tue Jun 28 14:53:13 BRT 2011
524+
Tue Nov 29 22:30:23 BRST 2011
526525
</SMALL>
527526
<!--
528-
Last change: revised for Lua 5.2.0 (beta)
527+
Last change: revised for Lua 5.2.0
529528
-->
530529

531530
</BODY>

doc/logo.gif

100755100644
File mode changed.

doc/lua.1

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
.\" $Id: lua.man,v 1.13 2011/11/16 17:16:53 lhf Exp $
2+
.TH LUA 1 "$Date: 2011/11/16 17:16:53 $"
3+
.SH NAME
4+
lua \- Lua interpreter
5+
.SH SYNOPSIS
6+
.B lua
7+
[
8+
.I options
9+
]
10+
[
11+
.I script
12+
[
13+
.I args
14+
]
15+
]
16+
.SH DESCRIPTION
17+
.B lua
18+
is the standalone Lua interpreter.
19+
It loads and executes Lua programs,
20+
either in textual source form or
21+
in precompiled binary form.
22+
(Precompiled binaries are output by
23+
.BR luac ,
24+
the Lua compiler.)
25+
.B lua
26+
can be used as a batch interpreter and also interactively.
27+
.LP
28+
The given
29+
.I options
30+
are handled in order and then
31+
the Lua program in file
32+
.I script
33+
is loaded and executed.
34+
The given
35+
.I args
36+
are available to
37+
.I script
38+
as strings in a global table named
39+
.BR arg .
40+
If no options or arguments are given,
41+
then
42+
.B "\-v \-i"
43+
is assumed when the standard input is a terminal;
44+
otherwise,
45+
.B "\-"
46+
is assumed.
47+
.LP
48+
In interactive mode,
49+
.B lua
50+
prompts the user,
51+
reads lines from the standard input,
52+
and executes them as they are read.
53+
If a line does not contain a complete statement,
54+
then a secondary prompt is displayed and
55+
lines are read until a complete statement is formed or
56+
a syntax error is found.
57+
If a line starts with
58+
.BR '=' ,
59+
then
60+
.B lua
61+
evaluates and displays
62+
the values of the expressions in the remainder of the line.
63+
.LP
64+
At the very start,
65+
before even handling the command line,
66+
.B lua
67+
checks the contents of the environment variables
68+
.B LUA_INIT_5_2
69+
or
70+
.BR LUA_INIT ,
71+
in that order.
72+
If the contents is of the form
73+
.RI '@ filename ',
74+
then
75+
.I filename
76+
is executed.
77+
Otherwise, the string is assumed to be a Lua statement and is executed.
78+
.SH OPTIONS
79+
.TP
80+
.BI \-e " stat"
81+
execute statement
82+
.IR stat .
83+
.TP
84+
.B \-i
85+
enter interactive mode after executing
86+
.IR script .
87+
.TP
88+
.BI \-l " name"
89+
execute the equivalent of
90+
.IB name =require(' name ')
91+
before executing
92+
.IR script .
93+
.TP
94+
.B \-v
95+
show version information.
96+
.TP
97+
.B \-E
98+
ignore environment variables.
99+
.TP
100+
.B \-\-
101+
stop handling options.
102+
.TP
103+
.B \-
104+
stop handling options and execute the standard input as a file.
105+
.SH "SEE ALSO"
106+
.BR luac (1)
107+
.br
108+
The documentation at lua.org,
109+
especially section 7 of the reference manual.
110+
.SH DIAGNOSTICS
111+
Error messages should be self explanatory.
112+
.SH AUTHORS
113+
R. Ierusalimschy,
114+
L. H. de Figueiredo,
115+
W. Celes
116+
.\" EOF

doc/lua.css

100755100644
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
body {
22
color: #000000 ;
33
background-color: #FFFFFF ;
4-
font-family: sans-serif ;
54
font-family: Helvetica, Arial, sans-serif ;
65
text-align: justify ;
76
margin-right: 20px ;
@@ -18,12 +17,13 @@ h2 {
1817
padding-top: 0.4em ;
1918
padding-bottom: 0.4em ;
2019
padding-left: 20px ;
20+
padding-right: 20px ;
2121
margin-left: -20px ;
2222
background-color: #E0E0FF ;
2323
}
2424

2525
h3 {
26-
padding-left: 8px ;
26+
padding-left: 0.5em ;
2727
border-left: solid #E0E0FF 1em ;
2828
}
2929

@@ -76,7 +76,6 @@ input[type=text] {
7676
-moz-border-radius: 2em ;
7777
background-image: url('images/search.png') ;
7878
background-repeat: no-repeat;
79-
background-position: left center ;
8079
background-position: 4px center ;
8180
padding-left: 20px ;
8281
height: 2em ;

doc/luac.1

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
.\" $Id: luac.man,v 1.29 2011/11/16 13:53:40 lhf Exp $
2+
.TH LUAC 1 "$Date: 2011/11/16 13:53:40 $"
3+
.SH NAME
4+
luac \- Lua compiler
5+
.SH SYNOPSIS
6+
.B luac
7+
[
8+
.I options
9+
] [
10+
.I filenames
11+
]
12+
.SH DESCRIPTION
13+
.B luac
14+
is the Lua compiler.
15+
It translates programs written in the Lua programming language
16+
into binary files containing precompiled chunks
17+
that can be later loaded and executed.
18+
.LP
19+
The main advantages of precompiling chunks are:
20+
faster loading,
21+
protecting source code from accidental user changes,
22+
and
23+
off-line syntax checking.
24+
Precompiling does not imply faster execution
25+
because in Lua chunks are always compiled into bytecodes before being executed.
26+
.B luac
27+
simply allows those bytecodes to be saved in a file for later execution.
28+
Precompiled chunks are not necessarily smaller than the corresponding source.
29+
The main goal in precompiling is faster loading.
30+
.LP
31+
In the command line,
32+
you can mix
33+
text files containing Lua source and
34+
binary files containing precompiled chunks.
35+
.B luac
36+
produces a single output file containing the combined bytecodes
37+
for all files given.
38+
Executing the combined file is equivalent to executing the given files.
39+
By default,
40+
the output file is named
41+
.BR luac.out ,
42+
but you can change this with the
43+
.B \-o
44+
option.
45+
.LP
46+
Precompiled chunks are
47+
.I not
48+
portable across different architectures.
49+
Moreover,
50+
the internal format of precompiled chunks
51+
is likely to change when a new version of Lua is released.
52+
Make sure you save the source files of all Lua programs that you precompile.
53+
.LP
54+
.SH OPTIONS
55+
.TP
56+
.B \-l
57+
produce a listing of the compiled bytecode for Lua's virtual machine.
58+
Listing bytecodes is useful to learn about Lua's virtual machine.
59+
If no files are given, then
60+
.B luac
61+
loads
62+
.B luac.out
63+
and lists its contents.
64+
Use
65+
.B \-l \-l
66+
for a full listing.
67+
.TP
68+
.BI \-o " file"
69+
output to
70+
.IR file ,
71+
instead of the default
72+
.BR luac.out .
73+
(You can use
74+
.B "'\-'"
75+
for standard output,
76+
but not on platforms that open standard output in text mode.)
77+
The output file may be one of the given files because
78+
all files are loaded before the output file is written.
79+
Be careful not to overwrite precious files.
80+
.TP
81+
.B \-p
82+
load files but do not generate any output file.
83+
Used mainly for syntax checking and for testing precompiled chunks:
84+
corrupted files will probably generate errors when loaded.
85+
If no files are given, then
86+
.B luac
87+
loads
88+
.B luac.out
89+
and tests its contents.
90+
No messages are displayed if the file loads without errors.
91+
.TP
92+
.B \-s
93+
strip debug information before writing the output file.
94+
This saves some space in very large chunks,
95+
but if errors occur when running a stripped chunk,
96+
then the error messages may not contain the full information they usually do.
97+
In particular,
98+
line numbers and names of local variables are lost.
99+
.TP
100+
.B \-v
101+
show version information.
102+
.TP
103+
.B \-\-
104+
stop handling options.
105+
.TP
106+
.B \-
107+
stop handling options and process standard input.
108+
.SH "SEE ALSO"
109+
.BR lua (1)
110+
.br
111+
The documentation at lua.org.
112+
.SH DIAGNOSTICS
113+
Error messages should be self explanatory.
114+
.SH AUTHORS
115+
R. Ierusalimschy,
116+
L. H. de Figueiredo,
117+
W. Celes
118+
.\" EOF

doc/manual.css

100755100644
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
h3 code {
22
font-family: inherit ;
3+
font-size: inherit ;
34
}
45

5-
pre {
6-
font-size: 105% ;
6+
pre, code {
7+
font-size: 12pt ;
78
}
89

910
span.apii {
1011
float: right ;
1112
font-family: inherit ;
13+
font-style: normal ;
14+
font-size: small ;
15+
color: gray ;
1216
}
1317

1418
p+h1, ul+h1 {

0 commit comments

Comments
 (0)