Lua updated to version 5.1.5.

This commit is contained in:
antirez 2013-04-29 12:00:54 +02:00
parent 48ede0d84d
commit 214adc5051
22 changed files with 194 additions and 136 deletions

2
deps/lua/COPYRIGHT vendored
View File

@ -9,7 +9,7 @@ For details and rationale, see http://www.lua.org/license.html .
=============================================================================== ===============================================================================
Copyright (C) 1994-2008 Lua.org, PUC-Rio. Copyright (C) 1994-2012 Lua.org, PUC-Rio.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

2
deps/lua/Makefile vendored
View File

@ -48,7 +48,7 @@ TO_MAN= lua.1 luac.1
# Lua version and release. # Lua version and release.
V= 5.1 V= 5.1
R= 5.1.4 R= 5.1.5
all: $(PLAT) all: $(PLAT)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 797 B

View File

@ -3,11 +3,10 @@
<HEAD> <HEAD>
<TITLE>Lua 5.1 Reference Manual - contents</TITLE> <TITLE>Lua 5.1 Reference Manual - contents</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="lua.css"> <LINK REL="stylesheet" TYPE="text/css" HREF="lua.css">
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1"> <META HTTP-EQUIV="content-type" CONTENT="text/html; charset=utf-8">
<STYLE TYPE="text/css"> <STYLE TYPE="text/css">
ul { ul {
list-style-type: none ; list-style-type: none ;
list-style-position: outside ;
} }
</STYLE> </STYLE>
</HEAD> </HEAD>
@ -20,7 +19,13 @@ ul {
Lua 5.1 Reference Manual Lua 5.1 Reference Manual
</H1> </H1>
This is an online version of <P>
The reference manual is the official definition of the Lua language.
For a complete introduction to Lua programming, see the book
<A HREF="http://www.lua.org/docs.html#pil">Programming in Lua</A>.
<P>
This manual is also available as a book:
<BLOCKQUOTE> <BLOCKQUOTE>
<A HREF="http://www.amazon.com/exec/obidos/ASIN/8590379833/lua-indexmanual-20"> <A HREF="http://www.amazon.com/exec/obidos/ASIN/8590379833/lua-indexmanual-20">
<IMG SRC="cover.png" ALT="" TITLE="buy from Amazon" BORDER=1 ALIGN="left" HSPACE=12> <IMG SRC="cover.png" ALT="" TITLE="buy from Amazon" BORDER=1 ALIGN="left" HSPACE=12>
@ -29,128 +34,119 @@ This is an online version of
<BR>by R. Ierusalimschy, L. H. de Figueiredo, W. Celes <BR>by R. Ierusalimschy, L. H. de Figueiredo, W. Celes
<BR>Lua.org, August 2006 <BR>Lua.org, August 2006
<BR>ISBN 85-903798-3-3 <BR>ISBN 85-903798-3-3
<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/8590379833/lua-indexmanual-20">
<IMG SRC="amazon.gif" ALT="[Buy from Amazon]" BORDER=0></A>
<BR CLEAR="all"> <BR CLEAR="all">
</BLOCKQUOTE> </BLOCKQUOTE>
<P>
Buy a copy of this book and <P>
<A HREF="http://www.amazon.com/exec/obidos/ASIN/8590379833/lua-indexmanual-20">Buy a copy</A>
of this book and
<A HREF="http://www.lua.org/donations.html">help to support</A> <A HREF="http://www.lua.org/donations.html">help to support</A>
the Lua project. the Lua project.
<P>
The reference manual is the official definition of the Lua language.
For a complete introduction to Lua programming, see the book
<A HREF="http://www.lua.org/docs.html#books">Programming in Lua</A>.
<P> <P>
<A HREF="manual.html">start</A> <A HREF="manual.html">start</A>
&middot; &middot;
<A HREF="#contents">contents</A> <A HREF="#contents">contents</A>
&middot; &middot;
<A HREF="#index">index</A> <A HREF="#index">index</A>
&middot; &middot;
<A HREF="http://www.lua.org/manual/5.1/pt/">português</A> <A HREF="http://www.lua.org/manual/">other versions</A>
&middot;
<A HREF="http://www.lua.org/manual/5.1/es/">español</A>
<HR> <HR>
<SMALL> <SMALL>
Copyright &copy; 2006-2008 Lua.org, PUC-Rio. Copyright &copy; 2006&ndash;2012 Lua.org, PUC-Rio.
Freely available under the terms of the Freely available under the terms of the
<a href="http://www.lua.org/license.html#5">Lua license</a>. <A HREF="http://www.lua.org/license.html">Lua license</A>.
</SMALL> </SMALL>
<P>
<H2><A NAME="contents">Contents</A></H2> <H2><A NAME="contents">Contents</A></H2>
<UL style="padding: 0"> <UL style="padding: 0">
<LI><A HREF="manual.html">1 - Introduction</A> <LI><A HREF="manual.html">1 &ndash; Introduction</A>
<P> <P>
<LI><A HREF="manual.html#2">2 - The Language</A> <LI><A HREF="manual.html#2">2 &ndash; The Language</A>
<UL> <UL>
<LI><A HREF="manual.html#2.1">2.1 - Lexical Conventions</A> <LI><A HREF="manual.html#2.1">2.1 &ndash; Lexical Conventions</A>
<LI><A HREF="manual.html#2.2">2.2 - Values and Types</A> <LI><A HREF="manual.html#2.2">2.2 &ndash; Values and Types</A>
<UL> <UL>
<LI><A HREF="manual.html#2.2.1">2.2.1 - Coercion</A> <LI><A HREF="manual.html#2.2.1">2.2.1 &ndash; Coercion</A>
</UL> </UL>
<LI><A HREF="manual.html#2.3">2.3 - Variables</A> <LI><A HREF="manual.html#2.3">2.3 &ndash; Variables</A>
<LI><A HREF="manual.html#2.4">2.4 - Statements</A> <LI><A HREF="manual.html#2.4">2.4 &ndash; Statements</A>
<UL> <UL>
<LI><A HREF="manual.html#2.4.1">2.4.1 - Chunks</A> <LI><A HREF="manual.html#2.4.1">2.4.1 &ndash; Chunks</A>
<LI><A HREF="manual.html#2.4.2">2.4.2 - Blocks</A> <LI><A HREF="manual.html#2.4.2">2.4.2 &ndash; Blocks</A>
<LI><A HREF="manual.html#2.4.3">2.4.3 - Assignment</A> <LI><A HREF="manual.html#2.4.3">2.4.3 &ndash; Assignment</A>
<LI><A HREF="manual.html#2.4.4">2.4.4 - Control Structures</A> <LI><A HREF="manual.html#2.4.4">2.4.4 &ndash; Control Structures</A>
<LI><A HREF="manual.html#2.4.5">2.4.5 - For Statement</A> <LI><A HREF="manual.html#2.4.5">2.4.5 &ndash; 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.6">2.4.6 &ndash; 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.7">2.4.7 &ndash; Local Declarations</A>
</UL> </UL>
<LI><A HREF="manual.html#2.5">2.5 - Expressions</A> <LI><A HREF="manual.html#2.5">2.5 &ndash; Expressions</A>
<UL> <UL>
<LI><A HREF="manual.html#2.5.1">2.5.1 - Arithmetic Operators</A> <LI><A HREF="manual.html#2.5.1">2.5.1 &ndash; Arithmetic Operators</A>
<LI><A HREF="manual.html#2.5.2">2.5.2 - Relational Operators</A> <LI><A HREF="manual.html#2.5.2">2.5.2 &ndash; Relational Operators</A>
<LI><A HREF="manual.html#2.5.3">2.5.3 - Logical Operators</A> <LI><A HREF="manual.html#2.5.3">2.5.3 &ndash; Logical Operators</A>
<LI><A HREF="manual.html#2.5.4">2.5.4 - Concatenation</A> <LI><A HREF="manual.html#2.5.4">2.5.4 &ndash; Concatenation</A>
<LI><A HREF="manual.html#2.5.5">2.5.5 - The Length Operator</A> <LI><A HREF="manual.html#2.5.5">2.5.5 &ndash; The Length Operator</A>
<LI><A HREF="manual.html#2.5.6">2.5.6 - Precedence</A> <LI><A HREF="manual.html#2.5.6">2.5.6 &ndash; Precedence</A>
<LI><A HREF="manual.html#2.5.7">2.5.7 - Table Constructors</A> <LI><A HREF="manual.html#2.5.7">2.5.7 &ndash; Table Constructors</A>
<LI><A HREF="manual.html#2.5.8">2.5.8 - Function Calls</A> <LI><A HREF="manual.html#2.5.8">2.5.8 &ndash; Function Calls</A>
<LI><A HREF="manual.html#2.5.9">2.5.9 - Function Definitions</A> <LI><A HREF="manual.html#2.5.9">2.5.9 &ndash; Function Definitions</A>
</UL> </UL>
<LI><A HREF="manual.html#2.6">2.6 - Visibility Rules</A> <LI><A HREF="manual.html#2.6">2.6 &ndash; Visibility Rules</A>
<LI><A HREF="manual.html#2.7">2.7 - Error Handling</A> <LI><A HREF="manual.html#2.7">2.7 &ndash; Error Handling</A>
<LI><A HREF="manual.html#2.8">2.8 - Metatables</A> <LI><A HREF="manual.html#2.8">2.8 &ndash; Metatables</A>
<LI><A HREF="manual.html#2.9">2.9 - Environments</A> <LI><A HREF="manual.html#2.9">2.9 &ndash; Environments</A>
<LI><A HREF="manual.html#2.10">2.10 - Garbage Collection</A> <LI><A HREF="manual.html#2.10">2.10 &ndash; Garbage Collection</A>
<UL> <UL>
<LI><A HREF="manual.html#2.10.1">2.10.1 - Garbage-Collection Metamethods</A> <LI><A HREF="manual.html#2.10.1">2.10.1 &ndash; Garbage-Collection Metamethods</A>
<LI><A HREF="manual.html#2.10.2">2.10.2 - Weak Tables</A> <LI><A HREF="manual.html#2.10.2">2.10.2 &ndash; Weak Tables</A>
</UL> </UL>
<LI><A HREF="manual.html#2.11">2.11 - Coroutines</A> <LI><A HREF="manual.html#2.11">2.11 &ndash; Coroutines</A>
</UL> </UL>
<P> <P>
<LI><A HREF="manual.html#3">3 - The Application Program Interface</A> <LI><A HREF="manual.html#3">3 &ndash; The Application Program Interface</A>
<UL> <UL>
<LI><A HREF="manual.html#3.1">3.1 - The Stack</A> <LI><A HREF="manual.html#3.1">3.1 &ndash; The Stack</A>
<LI><A HREF="manual.html#3.2">3.2 - Stack Size</A> <LI><A HREF="manual.html#3.2">3.2 &ndash; Stack Size</A>
<LI><A HREF="manual.html#3.3">3.3 - Pseudo-Indices</A> <LI><A HREF="manual.html#3.3">3.3 &ndash; Pseudo-Indices</A>
<LI><A HREF="manual.html#3.4">3.4 - C Closures</A> <LI><A HREF="manual.html#3.4">3.4 &ndash; C Closures</A>
<LI><A HREF="manual.html#3.5">3.5 - Registry</A> <LI><A HREF="manual.html#3.5">3.5 &ndash; Registry</A>
<LI><A HREF="manual.html#3.6">3.6 - Error Handling in C</A> <LI><A HREF="manual.html#3.6">3.6 &ndash; Error Handling in C</A>
<LI><A HREF="manual.html#3.7">3.7 - Functions and Types</A> <LI><A HREF="manual.html#3.7">3.7 &ndash; Functions and Types</A>
<LI><A HREF="manual.html#3.8">3.8 - The Debug Interface</A> <LI><A HREF="manual.html#3.8">3.8 &ndash; The Debug Interface</A>
</UL> </UL>
<P> <P>
<LI><A HREF="manual.html#4">4 - The Auxiliary Library</A> <LI><A HREF="manual.html#4">4 &ndash; The Auxiliary Library</A>
<UL> <UL>
<LI><A HREF="manual.html#4.1">4.1 - Functions and Types</A> <LI><A HREF="manual.html#4.1">4.1 &ndash; Functions and Types</A>
</UL> </UL>
<P> <P>
<LI><A HREF="manual.html#5">5 - Standard Libraries</A> <LI><A HREF="manual.html#5">5 &ndash; Standard Libraries</A>
<UL> <UL>
<LI><A HREF="manual.html#5.1">5.1 - Basic Functions</A> <LI><A HREF="manual.html#5.1">5.1 &ndash; Basic Functions</A>
<LI><A HREF="manual.html#5.2">5.2 - Coroutine Manipulation</A> <LI><A HREF="manual.html#5.2">5.2 &ndash; Coroutine Manipulation</A>
<LI><A HREF="manual.html#5.3">5.3 - Modules</A> <LI><A HREF="manual.html#5.3">5.3 &ndash; Modules</A>
<LI><A HREF="manual.html#5.4">5.4 - String Manipulation</A> <LI><A HREF="manual.html#5.4">5.4 &ndash; String Manipulation</A>
<UL> <UL>
<LI><A HREF="manual.html#5.4.1">5.4.1 - Patterns</A> <LI><A HREF="manual.html#5.4.1">5.4.1 &ndash; Patterns</A>
</UL> </UL>
<LI><A HREF="manual.html#5.5">5.5 - Table Manipulation</A> <LI><A HREF="manual.html#5.5">5.5 &ndash; Table Manipulation</A>
<LI><A HREF="manual.html#5.6">5.6 - Mathematical Functions</A> <LI><A HREF="manual.html#5.6">5.6 &ndash; Mathematical Functions</A>
<LI><A HREF="manual.html#5.7">5.7 - Input and Output Facilities</A> <LI><A HREF="manual.html#5.7">5.7 &ndash; Input and Output Facilities</A>
<LI><A HREF="manual.html#5.8">5.8 - Operating System Facilities</A> <LI><A HREF="manual.html#5.8">5.8 &ndash; Operating System Facilities</A>
<LI><A HREF="manual.html#5.9">5.9 - The Debug Library</A> <LI><A HREF="manual.html#5.9">5.9 &ndash; The Debug Library</A>
</UL> </UL>
<P> <P>
<LI><A HREF="manual.html#6">6 - Lua Stand-alone</A> <LI><A HREF="manual.html#6">6 &ndash; Lua Stand-alone</A>
<P> <P>
<LI><A HREF="manual.html#7">7 - Incompatibilities with the Previous Version</A> <LI><A HREF="manual.html#7">7 &ndash; Incompatibilities with the Previous Version</A>
<UL> <UL>
<LI><A HREF="manual.html#7.1">7.1 - Changes in the Language</A> <LI><A HREF="manual.html#7.1">7.1 &ndash; Changes in the Language</A>
<LI><A HREF="manual.html#7.2">7.2 - Changes in the Libraries</A> <LI><A HREF="manual.html#7.2">7.2 &ndash; Changes in the Libraries</A>
<LI><A HREF="manual.html#7.3">7.3 - Changes in the API</A> <LI><A HREF="manual.html#7.3">7.3 &ndash; Changes in the API</A>
</UL> </UL>
<P> <P>
<LI><A HREF="manual.html#8">8 - The Complete Syntax of Lua</A> <LI><A HREF="manual.html#8">8 &ndash; The Complete Syntax of Lua</A>
</UL> </UL>
<H2><A NAME="index">Index</A></H2> <H2><A NAME="index">Index</A></H2>
@ -160,6 +156,8 @@ Freely available under the terms of the
<H3><A NAME="functions">Lua functions</A></H3> <H3><A NAME="functions">Lua functions</A></H3>
<A HREF="manual.html#pdf-_G">_G</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-_VERSION">_VERSION</A><BR>
<P>
<A HREF="manual.html#pdf-assert">assert</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-collectgarbage">collectgarbage</A><BR>
<A HREF="manual.html#pdf-dofile">dofile</A><BR> <A HREF="manual.html#pdf-dofile">dofile</A><BR>
@ -487,12 +485,12 @@ Freely available under the terms of the
<P> <P>
<HR> <HR>
<SMALL> <SMALL CLASS="footer">
Last update: Last update:
Sat Jan 19 13:24:29 BRST 2008 Mon Feb 13 18:53:32 BRST 2012
</SMALL> </SMALL>
<!-- <!--
Last change: revised for Lua 5.1.3 Last change: revised for Lua 5.1.5
--> -->
</BODY> </BODY>

48
deps/lua/doc/lua.css vendored
View File

@ -1,17 +1,37 @@
body { body {
color: #000000 ; color: #000000 ;
background-color: #FFFFFF ; background-color: #FFFFFF ;
font-family: sans-serif ; font-family: Helvetica, Arial, sans-serif ;
text-align: justify ; text-align: justify ;
margin-right: 20px ; margin-right: 30px ;
margin-left: 20px ; margin-left: 30px ;
} }
h1, h2, h3, h4 { h1, h2, h3, h4 {
font-family: Verdana, Geneva, sans-serif ;
font-weight: normal ; font-weight: normal ;
font-style: italic ; font-style: italic ;
} }
h2 {
padding-top: 0.4em ;
padding-bottom: 0.4em ;
padding-left: 30px ;
padding-right: 30px ;
margin-left: -30px ;
background-color: #E0E0FF ;
}
h3 {
padding-left: 0.5em ;
border-left: solid #E0E0FF 1em ;
}
table h3 {
padding-left: 0px ;
border-left: none ;
}
a:link { a:link {
color: #000080 ; color: #000080 ;
background-color: inherit ; background-color: inherit ;
@ -39,3 +59,25 @@ hr {
background-color: #a0a0a0 ; background-color: #a0a0a0 ;
} }
:target {
background-color: #F8F8F8 ;
padding: 8px ;
border: solid #a0a0a0 2px ;
}
.footer {
color: gray ;
font-size: small ;
}
input[type=text] {
border: solid #a0a0a0 2px ;
border-radius: 2em ;
-moz-border-radius: 2em ;
background-image: url('images/search.png') ;
background-repeat: no-repeat;
background-position: 4px center ;
padding-left: 20px ;
height: 2em ;
}

View File

@ -1,13 +1,24 @@
h3 code { h3 code {
font-family: inherit ; font-family: inherit ;
font-size: inherit ;
} }
pre { pre, code {
font-size: 105% ; font-size: 12pt ;
} }
span.apii { span.apii {
float: right ; float: right ;
font-family: inherit ; font-family: inherit ;
font-style: normal ;
font-size: small ;
color: gray ;
} }
p+h1, ul+h1 {
padding-top: 0.4em ;
padding-bottom: 0.4em ;
padding-left: 30px ;
margin-left: -30px ;
background-color: #E0E0FF ;
}

View File

@ -19,9 +19,9 @@ Lua 5.1 Reference Manual
by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes by Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes
<p> <p>
<small> <small>
Copyright &copy; 2006-2008 Lua.org, PUC-Rio. Copyright &copy; 2006&ndash;2012 Lua.org, PUC-Rio.
Freely available under the terms of the Freely available under the terms of the
<a href="http://www.lua.org/license.html#5">Lua license</a>. <a href="http://www.lua.org/license.html">Lua license</a>.
</small> </small>
<hr> <hr>
<p> <p>
@ -29,11 +29,13 @@ Freely available under the terms of the
<a href="contents.html#contents">contents</A> <a href="contents.html#contents">contents</A>
&middot; &middot;
<a href="contents.html#index">index</A> <a href="contents.html#index">index</A>
&middot;
<A HREF="http://www.lua.org/manual/">other versions</A>
<!-- ====================================================================== --> <!-- ====================================================================== -->
<p> <p>
<!-- $Id: manual.of,v 1.48 2008/08/18 15:24:20 roberto Exp $ --> <!-- $Id: manual.of,v 1.49.1.2 2012/01/13 20:23:26 roberto Exp $ -->
@ -5645,7 +5647,7 @@ Currently, Lua has the following standard libraries:
<ul> <ul>
<li>basic library,</li> which includes the coroutine sub-library; <li>basic library, which includes the coroutine sub-library;</li>
<li>package library;</li> <li>package library;</li>
@ -5709,7 +5711,7 @@ when absent, it defaults to "assertion failed!"
<p> <p>
<hr><h3><a name="pdf-collectgarbage"><code>collectgarbage (opt [, arg])</code></a></h3> <hr><h3><a name="pdf-collectgarbage"><code>collectgarbage ([opt [, arg]])</code></a></h3>
<p> <p>
@ -5718,6 +5720,11 @@ It performs different functions according to its first argument, <code>opt</code
<ul> <ul>
<li><b>"collect":</b>
performs a full garbage-collection cycle.
This is the default option.
</li>
<li><b>"stop":</b> <li><b>"stop":</b>
stops the garbage collector. stops the garbage collector.
</li> </li>
@ -5726,10 +5733,6 @@ stops the garbage collector.
restarts the garbage collector. restarts the garbage collector.
</li> </li>
<li><b>"collect":</b>
performs a full garbage-collection cycle.
</li>
<li><b>"count":</b> <li><b>"count":</b>
returns the total memory in use by Lua (in Kbytes). returns the total memory in use by Lua (in Kbytes).
</li> </li>
@ -5760,7 +5763,7 @@ Returns the previous value for <em>step</em>.
<p> <p>
<hr><h3><a name="pdf-dofile"><code>dofile (filename)</code></a></h3> <hr><h3><a name="pdf-dofile"><code>dofile ([filename])</code></a></h3>
Opens the named file and executes its contents as a Lua chunk. Opens the named file and executes its contents as a Lua chunk.
When called without arguments, When called without arguments,
<code>dofile</code> executes the contents of the standard input (<code>stdin</code>). <code>dofile</code> executes the contents of the standard input (<code>stdin</code>).
@ -8421,7 +8424,7 @@ Otherwise, it returns the name of the upvalue.
<p> <p>
<hr><h3><a name="pdf-debug.traceback"><code>debug.traceback ([thread,] [message] [, level])</code></a></h3> <hr><h3><a name="pdf-debug.traceback"><code>debug.traceback ([thread,] [message [, level]])</code></a></h3>
<p> <p>
@ -8789,12 +8792,12 @@ Here is the complete syntax of Lua in extended BNF.
<HR> <HR>
<SMALL> <SMALL CLASS="footer">
Last update: Last update:
Mon Aug 18 13:25:46 BRT 2008 Mon Feb 13 18:54:19 BRST 2012
</SMALL> </SMALL>
<!-- <!--
Last change: revised for Lua 5.1.4 Last change: revised for Lua 5.1.5
--> -->
</body></html> </body></html>

View File

@ -12,7 +12,7 @@
Documentation Documentation
</H1> </H1>
This is the documentation included in the source distribution of Lua 5.1.4. This is the documentation included in the source distribution of Lua 5.1.5.
<UL> <UL>
<LI><A HREF="contents.html">Reference manual</A> <LI><A HREF="contents.html">Reference manual</A>
@ -33,7 +33,7 @@ especially the
<HR> <HR>
<SMALL> <SMALL>
Last update: Last update:
Tue Aug 12 14:46:07 BRT 2008 Fri Feb 3 09:44:42 BRST 2012
</SMALL> </SMALL>
</BODY> </BODY>

2
deps/lua/etc/lua.pc vendored
View File

@ -5,7 +5,7 @@
# grep '^V=' ../Makefile # grep '^V=' ../Makefile
V= 5.1 V= 5.1
# grep '^R=' ../Makefile # grep '^R=' ../Makefile
R= 5.1.4 R= 5.1.5
# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
prefix= /usr/local prefix= /usr/local

View File

@ -48,7 +48,7 @@ o: $(ALL_O)
a: $(ALL_A) a: $(ALL_A)
$(LUA_A): $(CORE_O) $(LIB_O) $(LUA_A): $(CORE_O) $(LIB_O)
$(AR) $@ $? $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
$(RANLIB) $@ $(RANLIB) $@
$(LUA_T): $(LUA_O) $(LUA_A) $(LUA_T): $(LUA_O) $(LUA_A)

View File

@ -631,7 +631,7 @@ static void base_open (lua_State *L) {
luaL_register(L, "_G", base_funcs); luaL_register(L, "_G", base_funcs);
lua_pushliteral(L, LUA_VERSION); lua_pushliteral(L, LUA_VERSION);
lua_setglobal(L, "_VERSION"); /* set global _VERSION */ lua_setglobal(L, "_VERSION"); /* set global _VERSION */
/* `ipairs' and `pairs' need auxliliary functions as upvalues */ /* `ipairs' and `pairs' need auxiliary functions as upvalues */
auxopen(L, "ipairs", luaB_ipairs, ipairsaux); auxopen(L, "ipairs", luaB_ipairs, ipairsaux);
auxopen(L, "pairs", luaB_pairs, luaB_next); auxopen(L, "pairs", luaB_pairs, luaB_next);
/* `newproxy' needs a weaktable as upvalue */ /* `newproxy' needs a weaktable as upvalue */

10
deps/lua/src/lcode.c vendored
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $ ** $Id: lcode.c,v 2.25.1.5 2011/01/31 14:53:16 roberto Exp $
** Code generator for Lua ** Code generator for Lua
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -544,10 +544,6 @@ void luaK_goiftrue (FuncState *fs, expdesc *e) {
pc = NO_JUMP; /* always true; do nothing */ pc = NO_JUMP; /* always true; do nothing */
break; break;
} }
case VFALSE: {
pc = luaK_jump(fs); /* always jump */
break;
}
case VJMP: { case VJMP: {
invertjump(fs, e); invertjump(fs, e);
pc = e->u.s.info; pc = e->u.s.info;
@ -572,10 +568,6 @@ static void luaK_goiffalse (FuncState *fs, expdesc *e) {
pc = NO_JUMP; /* always false; do nothing */ pc = NO_JUMP; /* always false; do nothing */
break; break;
} }
case VTRUE: {
pc = luaK_jump(fs); /* always jump */
break;
}
case VJMP: { case VJMP: {
pc = e->u.s.info; pc = e->u.s.info;
break; break;

View File

@ -1,5 +1,5 @@
/* /*
** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $ ** $Id: ldblib.c,v 1.104.1.4 2009/08/04 18:50:18 roberto Exp $
** Interface from Lua to its debug API ** Interface from Lua to its debug API
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -45,6 +45,7 @@ static int db_setmetatable (lua_State *L) {
static int db_getfenv (lua_State *L) { static int db_getfenv (lua_State *L) {
luaL_checkany(L, 1);
lua_getfenv(L, 1); lua_getfenv(L, 1);
return 1; return 1;
} }

3
deps/lua/src/ldo.c vendored
View File

@ -1,5 +1,5 @@
/* /*
** $Id: ldo.c,v 2.38.1.3 2008/01/18 22:31:22 roberto Exp $ ** $Id: ldo.c,v 2.38.1.4 2012/01/18 02:27:10 roberto Exp $
** Stack and Call structure of Lua ** Stack and Call structure of Lua
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -217,6 +217,7 @@ static StkId adjust_varargs (lua_State *L, Proto *p, int actual) {
int nvar = actual - nfixargs; /* number of extra arguments */ int nvar = actual - nfixargs; /* number of extra arguments */
lua_assert(p->is_vararg & VARARG_HASARG); lua_assert(p->is_vararg & VARARG_HASARG);
luaC_checkGC(L); luaC_checkGC(L);
luaD_checkstack(L, p->maxstacksize);
htab = luaH_new(L, nvar, 1); /* create `arg' table */ htab = luaH_new(L, nvar, 1); /* create `arg' table */
for (i=0; i<nvar; i++) /* put extra arguments into `arg' table */ for (i=0; i<nvar; i++) /* put extra arguments into `arg' table */
setobj2n(L, luaH_setnum(L, htab, i+1), L->top - nvar + i); setobj2n(L, luaH_setnum(L, htab, i+1), L->top - nvar + i);

3
deps/lua/src/lgc.c vendored
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $ ** $Id: lgc.c,v 2.38.1.2 2011/03/18 18:05:38 roberto Exp $
** Garbage Collector ** Garbage Collector
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -627,7 +627,6 @@ void luaC_step (lua_State *L) {
} }
} }
else { else {
lua_assert(g->totalbytes >= g->estimate);
setthreshold(g); setthreshold(g);
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $ ** $Id: liolib.c,v 2.73.1.4 2010/05/14 15:33:51 roberto Exp $
** Standard I/O (and system) library ** Standard I/O (and system) library
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -276,7 +276,10 @@ static int read_number (lua_State *L, FILE *f) {
lua_pushnumber(L, d); lua_pushnumber(L, d);
return 1; return 1;
} }
else return 0; /* read fails */ else {
lua_pushnil(L); /* "result" to be removed */
return 0; /* read fails */
}
} }

6
deps/lua/src/llex.c vendored
View File

@ -1,5 +1,5 @@
/* /*
** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $ ** $Id: llex.c,v 2.20.1.2 2009/11/23 14:58:22 roberto Exp $
** Lexical Analyzer ** Lexical Analyzer
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -118,8 +118,10 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
lua_State *L = ls->L; lua_State *L = ls->L;
TString *ts = luaS_newlstr(L, str, l); TString *ts = luaS_newlstr(L, str, l);
TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */ TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */
if (ttisnil(o)) if (ttisnil(o)) {
setbvalue(o, 1); /* make sure `str' will not be collected */ setbvalue(o, 1); /* make sure `str' will not be collected */
luaC_checkGC(L);
}
return ts; return ts;
} }

View File

@ -1,5 +1,5 @@
/* /*
** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $ ** $Id: loadlib.c,v 1.52.1.4 2009/09/09 13:17:16 roberto Exp $
** Dynamic library loader for Lua ** Dynamic library loader for Lua
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
** **
@ -639,7 +639,7 @@ LUALIB_API int luaopen_package (lua_State *L) {
lua_pushvalue(L, -1); lua_pushvalue(L, -1);
lua_replace(L, LUA_ENVIRONINDEX); lua_replace(L, LUA_ENVIRONINDEX);
/* create `loaders' table */ /* create `loaders' table */
lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1); lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0);
/* fill it with pre-defined loaders */ /* fill it with pre-defined loaders */
for (i=0; loaders[i] != NULL; i++) { for (i=0; loaders[i] != NULL; i++) {
lua_pushcfunction(L, loaders[i]); lua_pushcfunction(L, loaders[i]);

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lparser.c,v 2.42.1.3 2007/12/28 15:32:23 roberto Exp $ ** $Id: lparser.c,v 2.42.1.4 2011/10/21 19:31:42 roberto Exp $
** Lua Parser ** Lua Parser
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -374,9 +374,9 @@ static void close_func (LexState *ls) {
lua_assert(luaG_checkcode(f)); lua_assert(luaG_checkcode(f));
lua_assert(fs->bl == NULL); lua_assert(fs->bl == NULL);
ls->fs = fs->prev; ls->fs = fs->prev;
L->top -= 2; /* remove table and prototype from the stack */
/* last token read was anchored in defunct function; must reanchor it */ /* last token read was anchored in defunct function; must reanchor it */
if (fs) anchor_token(ls); if (fs) anchor_token(ls);
L->top -= 2; /* remove table and prototype from the stack */
} }

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $ ** $Id: lstrlib.c,v 1.132.1.5 2010/05/14 15:34:19 roberto Exp $
** Standard library for string operations and pattern-matching ** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -754,6 +754,7 @@ static void addintlen (char *form) {
static int str_format (lua_State *L) { static int str_format (lua_State *L) {
int top = lua_gettop(L);
int arg = 1; int arg = 1;
size_t sfl; size_t sfl;
const char *strfrmt = luaL_checklstring(L, arg, &sfl); const char *strfrmt = luaL_checklstring(L, arg, &sfl);
@ -768,7 +769,8 @@ static int str_format (lua_State *L) {
else { /* format item */ else { /* format item */
char form[MAX_FORMAT]; /* to store the format (`%...') */ char form[MAX_FORMAT]; /* to store the format (`%...') */
char buff[MAX_ITEM]; /* to store the formatted item */ char buff[MAX_ITEM]; /* to store the formatted item */
arg++; if (++arg > top)
luaL_argerror(L, arg, "no value");
strfrmt = scanformat(L, strfrmt, form); strfrmt = scanformat(L, strfrmt, form);
switch (*strfrmt++) { switch (*strfrmt++) {
case 'c': { case 'c': {

8
deps/lua/src/lua.h vendored
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $ ** $Id: lua.h,v 1.218.1.7 2012/01/13 20:36:20 roberto Exp $
** Lua - An Extensible Extension Language ** Lua - An Extensible Extension Language
** Lua.org, PUC-Rio, Brazil (http://www.lua.org) ** Lua.org, PUC-Rio, Brazil (http://www.lua.org)
** See Copyright Notice at the end of this file ** See Copyright Notice at the end of this file
@ -17,9 +17,9 @@
#define LUA_VERSION "Lua 5.1" #define LUA_VERSION "Lua 5.1"
#define LUA_RELEASE "Lua 5.1.4" #define LUA_RELEASE "Lua 5.1.5"
#define LUA_VERSION_NUM 501 #define LUA_VERSION_NUM 501
#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio" #define LUA_COPYRIGHT "Copyright (C) 1994-2012 Lua.org, PUC-Rio"
#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes"
@ -362,7 +362,7 @@ struct lua_Debug {
/****************************************************************************** /******************************************************************************
* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved. * Copyright (C) 1994-2012 Lua.org, PUC-Rio. All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining * Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the * a copy of this software and associated documentation files (the

8
deps/lua/src/lvm.c vendored
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $ ** $Id: lvm.c,v 2.63.1.5 2011/08/17 20:43:11 roberto Exp $
** Lua virtual machine ** Lua virtual machine
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -133,6 +133,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {
void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
int loop; int loop;
TValue temp;
for (loop = 0; loop < MAXTAGLOOP; loop++) { for (loop = 0; loop < MAXTAGLOOP; loop++) {
const TValue *tm; const TValue *tm;
if (ttistable(t)) { /* `t' is a table? */ if (ttistable(t)) { /* `t' is a table? */
@ -141,6 +142,7 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
if (!ttisnil(oldval) || /* result is no nil? */ if (!ttisnil(oldval) || /* result is no nil? */
(tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */ (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
setobj2t(L, oldval, val); setobj2t(L, oldval, val);
h->flags = 0;
luaC_barriert(L, h, val); luaC_barriert(L, h, val);
return; return;
} }
@ -152,7 +154,9 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
callTM(L, tm, t, key, val); callTM(L, tm, t, key, val);
return; return;
} }
t = tm; /* else repeat with `tm' */ /* else repeat with `tm' */
setobj(L, &temp, tm); /* avoid pointing inside table (may rehash) */
t = &temp;
} }
luaG_runerror(L, "loop in settable"); luaG_runerror(L, "loop in settable");
} }