History

Lua 5.2.0-alpha-rc3

Lua Team committed 15 years ago

Commit e22e2031 parent df8e5b67 files · +132 −134Browse files

Unified · Split

7 files
  1. doc/contents.html +11 −11
  2. doc/manual.html +97 −93
  3. doc/readme.html +3 −3
  4. src/lbitlib.c +13 −13
  5. src/llex.c +2 −2
  6. src/lmathlib.c +5 −4
  7. src/lstrlib.c +1 −8
doc/contents.html+11−11
@@ -172,16 +172,16 @@ Freely available under the terms of the · 171 unmodified lines
172172 <A HREF="manual.html#pdf-xpcall">xpcall</A><BR>
173173
174174 <P>
175−<A HREF="manual.html#pdf-bit32.AND">bit32.AND</A><BR>
176−<A HREF="manual.html#pdf-bit32.NOT">bit32.NOT</A><BR>
177−<A HREF="manual.html#pdf-bit32.OR">bit32.OR</A><BR>
178−<A HREF="manual.html#pdf-bit32.ROL">bit32.ROL</A><BR>
179−<A HREF="manual.html#pdf-bit32.ROR">bit32.ROR</A><BR>
180−<A HREF="manual.html#pdf-bit32.SAR">bit32.SAR</A><BR>
181−<A HREF="manual.html#pdf-bit32.SHL">bit32.SHL</A><BR>
182−<A HREF="manual.html#pdf-bit32.SHR">bit32.SHR</A><BR>
183−<A HREF="manual.html#pdf-bit32.TEST">bit32.TEST</A><BR>
184−<A HREF="manual.html#pdf-bit32.XOR">bit32.XOR</A><BR>
175+<A HREF="manual.html#pdf-bit32.arshift">bit32.arshift</A><BR>
176+<A HREF="manual.html#pdf-bit32.band">bit32.band</A><BR>
177+<A HREF="manual.html#pdf-bit32.bnot">bit32.bnot</A><BR>
178+<A HREF="manual.html#pdf-bit32.bor">bit32.bor</A><BR>
179+<A HREF="manual.html#pdf-bit32.btest">bit32.btest</A><BR>
180+<A HREF="manual.html#pdf-bit32.bxor">bit32.bxor</A><BR>
181+<A HREF="manual.html#pdf-bit32.lrotate">bit32.lrotate</A><BR>
182+<A HREF="manual.html#pdf-bit32.lshift">bit32.lshift</A><BR>
183+<A HREF="manual.html#pdf-bit32.rrotate">bit32.rrotate</A><BR>
184+<A HREF="manual.html#pdf-bit32.rshift">bit32.rshift</A><BR>
185185
186186 <P>
187187 <A HREF="manual.html#pdf-coroutine.create">coroutine.create</A><BR>
@@ -516,7 +516,7 @@ Freely available under the terms of the · 328 unmodified lines
516516 <HR>
517517 <SMALL>
518518 Last update:
519−Wed Nov 17 14:51:24 BRST 2010
519+Mon Nov 22 16:38:54 BRST 2010
520520 </SMALL>
521521 <!--
522522 Last change: revised for Lua 5.2.0 (alpha)
doc/manual.html+97−93
@@ -38,7 +38,7 @@ Freely available under the terms of the · 37 unmodified lines
3838 <!-- ====================================================================== -->
3939 <p>
4040
41−<!-- $Id: manual.of,v 1.63 2010/11/17 15:35:05 roberto Exp $ -->
41+<!-- $Id: manual.of,v 1.66 2010/11/22 18:07:40 roberto Exp $ -->
4242
4343
4444
@@ -53,22 +53,23 @@ It also offers good support for object-oriented programming, · 8 unmodified lines
5353 functional programming, and data-driven programming.
5454 Lua is intended to be used as a powerful, light-weight
5555 scripting language for any program that needs one.
56−Lua is implemented as a library, written in <em>clean</em> C
57−(that is, in the common subset of ANSI&nbsp;C and C++).
56+Lua is implemented as a library, written in <em>clean</em> C,
57+the common subset of ANSI&nbsp;C and C++.
5858
5959
6060 <p>
6161 Being an extension language, Lua has no notion of a "main" program:
6262 it only works <em>embedded</em> in a host client,
6363 called the <em>embedding program</em> or simply the <em>host</em>.
64−This host program can invoke functions to execute a piece of Lua code,
64+The host program can invoke functions to execute a piece of Lua code,
6565 can write and read Lua variables,
6666 and can register C&nbsp;functions to be called by Lua code.
6767 Through the use of C&nbsp;functions, Lua can be augmented to cope with
6868 a wide range of different domains,
6969 thus creating customized programming languages sharing a syntactical framework.
7070 The Lua distribution includes a sample host program called <code>lua</code>,
71−which uses the Lua library to offer a complete, standalone Lua interpreter.
71+which uses the Lua library to offer a complete, standalone Lua interpreter,
72+for interactive or batch use.
7273
7374
7475 <p>
@@ -85,7 +86,7 @@ this document is dry in places. · 10 unmodified lines
8586 For a discussion of the decisions behind the design of Lua,
8687 see the technical papers available at Lua's web site.
8788 For a detailed introduction to programming in Lua,
88−see Roberto's book, <em>Programming in Lua (Second Edition)</em>.
89+see Roberto's book, <em>Programming in Lua</em> (second edition).
8990
9091
9192
@@ -126,7 +127,7 @@ any other value makes it true. · 34 unmodified lines
126127 <em>Number</em> represents real (double-precision floating-point) numbers.
127128 (It is easy to build Lua interpreters that use other
128129 internal representations for numbers,
129−such as single-precision float or long integers;
130+such as single-precision floats or long integers;
130131 see file <code>luaconf.h</code>.)
131132 <em>String</em> represents arrays of characters.
132133
@@ -211,7 +212,7 @@ of a given value. · 78 unmodified lines
211212 As discussed in <a href="#3.2">&sect;3.2</a> and <a href="#3.3.3">&sect;3.3.3</a>,
212213 any reference to a global name <code>var</code> is syntactically translated
213214 to <code>_ENV.var</code>.
214−Moreover, any chunk is compiled in the scope of an external
215+Moreover, every chunk is compiled in the scope of an external
215216 variable called <code>_ENV</code> (see <a href="#3.3.2">&sect;3.3.2</a>),
216217 so <code>_ENV</code> itself is never a global name in a chunk.
217218
@@ -256,7 +257,7 @@ If you change the global environment in the registry · 38 unmodified lines
256257 (through C code or the debug library),
257258 all chunks loaded after the change will get the new environment.
258259 Previously loaded chunks are not affected, however,
259−as each has its own copy of the environment in its <code>_ENV</code> variable.
260+as each has its own reference to the environment in its <code>_ENV</code> variable.
260261 Moreover, the variable <a href="#pdf-_G"><code>_G</code></a>
261262 (which is stored in the original global environment)
262263 is never updated by Lua.
@@ -271,8 +272,9 @@ is never updated by Lua. · 8 unmodified lines
271272 Because Lua is an embedded extension language,
272273 all Lua actions start from C&nbsp;code in the host program
273274 calling a function from the Lua library (see <a href="#lua_pcall"><code>lua_pcall</code></a>).
274−Whenever an error occurs during Lua compilation or execution,
275−control returns to C,
275+Whenever an error occurs during
276+the compilation or execution of a Lua chunk,
277+control returns to the host,
276278 which can take appropriate measures
277279 (such as printing an error message).
278280
@@ -281,7 +283,7 @@ which can take appropriate measures · 2 unmodified lines
281283 Lua code can explicitly generate an error by calling the
282284 <a href="#pdf-error"><code>error</code></a> function.
283285 If you need to catch errors in Lua,
284−you can use the <a href="#pdf-pcall"><code>pcall</code></a> function.
286+you can use the <a href="#pdf-pcall"><code>pcall</code></a> or the <a href="#pdf-xpcall"><code>xpcall</code></a> function.
285287
286288
287289
@@ -297,27 +299,26 @@ under certain special operations. · 9 unmodified lines
297299 You can change several aspects of the behavior
298300 of operations over a value by setting specific fields in its metatable.
299301 For instance, when a non-numeric value is the operand of an addition,
300−Lua checks for a function in the field "<code>__add</code>" in its metatable.
302+Lua checks for a function in the field "<code>__add</code>" of the value's metatable.
301303 If it finds one,
302304 Lua calls this function to perform the addition.
303305
304306
305307 <p>
306−We call the keys in a metatable <em>events</em>
307−and the values <em>metamethods</em>.
308−In the previous example, the event is <code>"__add"</code>
308+The keys in a metatable are derived from the <em>event</em> names;
309+the corresponding values are called <em>metamethods</em>.
310+In the previous example, the event is <code>"add"</code>
309311 and the metamethod is the function that performs the addition.
310312
311313
312314 <p>
313315 You can query the metatable of any value
314−through the <a href="#pdf-getmetatable"><code>getmetatable</code></a> function.
316+using the <a href="#pdf-getmetatable"><code>getmetatable</code></a> function.
315317
316318
317319 <p>
318320 You can replace the metatable of tables
319−through the <a href="#pdf-setmetatable"><code>setmetatable</code></a>
320−function.
321+using the <a href="#pdf-setmetatable"><code>setmetatable</code></a> function.
321322 You cannot change the metatable of other types from Lua
322323 (except by using the debug library);
323324 you must use the C&nbsp;API for that.
@@ -338,8 +339,6 @@ A metatable controls how an object behaves in arithmetic operations, · 14 unmodified lines
338339 order comparisons, concatenation, length operation, and indexing.
339340 A metatable also can define a function to be called when a userdata
340341 is garbage collected.
341−For each of these operations Lua associates a specific key
342−called an <em>event</em>.
343342 When Lua performs one of these operations over a value,
344343 it checks whether this value has a metatable with the corresponding event.
345344 If so, the value associated with that key (the metamethod)
@@ -353,11 +352,11 @@ The key for each operation is a string with its name prefixed by · 7 unmodified lines
353352 two underscores, '<code>__</code>';
354353 for instance, the key for operation "add" is the
355354 string "<code>__add</code>".
356−The semantics of these operations is better explained by a Lua function
357−describing how the interpreter executes the operation.
358355
359356
360357 <p>
358+The semantics of these operations is better explained by a Lua function
359+describing how the interpreter executes the operation.
361360 The code shown here in Lua is only illustrative;
362361 the real behavior is hard coded in the interpreter
363362 and it is much more efficient than this simulation.
@@ -719,7 +718,7 @@ It uses two numbers to control its garbage-collection cycles: · 355 unmodified lines
719718 the <em>garbage-collector pause</em> and
720719 the <em>garbage-collector step multiplier</em>.
721720 Both use percentage points as units
722−(so that a value of 100 means an internal value of 1).
721+(e.g., a value of 100 means an internal value of 1).
723722
724723
725724 <p>
@@ -733,14 +732,15 @@ to double before starting a new cycle. · 7 unmodified lines
733732
734733
735734 <p>
736−The step multiplier
735+The garbage-collector step multiplier
737736 controls the relative speed of the collector relative to
738737 memory allocation.
739738 Larger values make the collector more aggressive but also increase
740739 the size of each incremental step.
741740 Values smaller than 100 make the collector too slow and
742741 can result in the collector never finishing a cycle.
743−The default, 200, means that the collector runs at "twice"
742+The default is 200,
743+which means that the collector runs at "twice"
744744 the speed of memory allocation.
745745
746746
@@ -767,7 +767,7 @@ the collector directly (e.g., stop and restart it). · 20 unmodified lines
767767
768768 <p>
769769 Using the C&nbsp;API,
770−you can set garbage-collector metamethods for userdata (see <a href="#2.4">&sect;2.4</a>).
770+you can set garbage-collector metamethods for full userdata (see <a href="#2.4">&sect;2.4</a>).
771771 These metamethods are also called <em>finalizers</em>.
772772 Finalizers allow you to coordinate Lua's garbage collection
773773 with external resource management
@@ -777,12 +777,12 @@ or freeing your own memory). · 3 unmodified lines
777777
778778 <p>
779779 For a userdata to be finalized when collected,
780−you must <em>mark</em> it first.
780+you must <em>mark</em> it for finalization.
781781
782782 You mark a userdata for finalization when you set its metatable
783783 and the metatable has a field indexed by the string "<code>__gc</code>".
784784 Note that if you set a metatable without a <code>__gc</code> field
785−and later create that field,
785+and later create that field in the metatable,
786786 the userdata will not be marked for finalization.
787787 However, after a userdata is marked,
788788 you can freely change the <code>__gc</code> field of its metatable.
@@ -826,7 +826,7 @@ A <em>weak table</em> is a table whose elements are · 37 unmodified lines
826826 A weak reference is ignored by the garbage collector.
827827 In other words,
828828 if the only references to an object are weak references,
829−then the garbage collector will collect this object.
829+then the garbage collector will collect that object.
830830
831831
832832 <p>
@@ -873,11 +873,11 @@ Lua treats strings and light C functions as non-object values. · 40 unmodified lines
873873
874874
875875 <p>
876−Userdata marked for finalization has a special behavior in weak tables.
876+Userdata marked for finalization have a special behavior in weak tables.
877877 When a marked userdata is a value in a weak table,
878878 it is removed from the table the first time it is collected,
879879 before running its finalizer.
880−When it is a key, however,
880+However, when it is a key,
881881 it is removed from the table only when it is really freed,
882882 after running its finalizer.
883883 This behavior allows the finalizer to access values
@@ -901,15 +901,16 @@ a yield function. · 17 unmodified lines
901901
902902
903903 <p>
904−You create a coroutine with a call to <a href="#pdf-coroutine.create"><code>coroutine.create</code></a>.
904+You create a coroutine by calling <a href="#pdf-coroutine.create"><code>coroutine.create</code></a>.
905905 Its sole argument is a function
906906 that is the main function of the coroutine.
907907 The <code>create</code> function only creates a new coroutine and
908908 returns a handle to it (an object of type <em>thread</em>);
909−it does not start the coroutine execution.
909+it does not start the coroutine.
910910
911911
912912 <p>
913+You execute a coroutine by calling <a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a>.
913914 When you first call <a href="#pdf-coroutine.resume"><code>coroutine.resume</code></a>,
914915 passing as its first argument
915916 a thread returned by <a href="#pdf-coroutine.create"><code>coroutine.create</code></a>,
@@ -962,7 +963,7 @@ any error is propagated to the caller. · 46 unmodified lines
962963
963964
964965 <p>
965−As an example,
966+As an example of how coroutines work,
966967 consider the following code:
967968
968969 <pre>
@@ -3659,6 +3660,11 @@ the value at the given index; · 2690 unmodified lines
36593660 this confuses the next call to <a href="#lua_next"><code>lua_next</code></a>.
36603661
36613662
3663+<p>
3664+See function <a href="#pdf-next"><code>next</code></a> for the caveats of modifying
3665+the table during its traversal.
3666+
3667+
36623668
36633669
36643670
@@ -6972,7 +6978,7 @@ and "<code>userdata</code>". · 3307 unmodified lines
69726978 <hr><h3><a name="pdf-_VERSION"><code>_VERSION</code></a></h3>
69736979 A global variable (not a function) that
69746980 holds a string containing the current interpreter version.
6975−The current contents of this variable is "<code>Lua 5.1</code>".
6981+The current contents of this variable is "<code>Lua 5.2</code>".
69766982
69776983
69786984
@@ -7665,9 +7671,9 @@ Here are some examples: · 686 unmodified lines
76657671 end)
76667672 --&gt; x="4+5 = 9"
76677673
7668− local t = {name="lua", version="5.1"}
7674+ local t = {name="lua", version="5.2"}
76697675 x = string.gsub("$name-$version.tar.gz", "%$(%w+)", t)
7670− --&gt; x="lua-5.1.tar.gz"
7676+ --&gt; x="lua-5.2.tar.gz"
76717677 </pre>
76727678
76737679
@@ -8385,8 +8391,6 @@ Returns the hyperbolic tangent of <code>x</code>. · 711 unmodified lines
83858391 <p>
83868392 This library provides bitwise operations.
83878393 It provides all its functions inside the table <a name="pdf-bit32"><code>bit32</code></a>.
8388−It uses upper case for function names to avoid collision with
8389−some reserved words (<b>and</b>, <b>or</b>, and <b>not</b>).
83908394
83918395
83928396 <p>
@@ -8398,12 +8402,34 @@ the remainder of its division by <em>2<sup>32</sup></em> · 5 unmodified lines
83988402 and truncated to an integer (in some unspecified way),
83998403 so that its final value falls in the range <em>[0,2<sup>32</sup> - 1]</em>.
84008404 Similarly, all results are in the range <em>[0,2<sup>32</sup> - 1]</em>.
8401−Note that <code>bit32.NOT(0)</code> is <code>0xFFFFFFFF</code>,
8405+Note that <code>bit32.bnot(0)</code> is <code>0xFFFFFFFF</code>,
84028406 which is different from <code>-1</code>.
84038407
84048408
84058409 <p>
8406−<hr><h3><a name="pdf-bit32.AND"><code>bit32.AND (&middot;&middot;&middot;)</code></a></h3>
8410+<hr><h3><a name="pdf-bit32.arshift"><code>bit32.arshift (x, disp)</code></a></h3>
8411+
8412+
8413+<p>
8414+Returns the number <code>x</code> shifted <code>disp</code> bits to the right.
8415+The number <code>disp</code> may be any representable integer.
8416+Negative displacements shift to the left.
8417+
8418+
8419+<p>
8420+This shift operation is what is called arithmetic shift.
8421+Vacant bits on the left are filled
8422+with copies of the higher bit of <code>x</code>;
8423+vacant bits on the right are filled with zeros.
8424+In particular,
8425+displacements with absolute values higher than 31
8426+result in zero or <code>0xFFFFFFFF</code> (all original bits are shifted out).
8427+
8428+
8429+
8430+
8431+<p>
8432+<hr><h3><a name="pdf-bit32.band"><code>bit32.band (&middot;&middot;&middot;)</code></a></h3>
84078433
84088434
84098435 <p>
@@ -8413,7 +8439,7 @@ Returns the bitwise and of its operands. · 3 unmodified lines
84138439
84148440
84158441 <p>
8416−<hr><h3><a name="pdf-bit32.NOT"><code>bit32.NOT (x)</code></a></h3>
8442+<hr><h3><a name="pdf-bit32.bnot"><code>bit32.bnot (x)</code></a></h3>
84178443
84188444
84198445 <p>
@@ -8422,13 +8448,13 @@ For any integer <code>x</code>, · 2 unmodified lines
84228448 the following identity holds:
84238449
84248450 <pre>
8425− assert(bit32.NOT(x) == (-1 - x) % 2^32)
8451+ assert(bit32.bnot(x) == (-1 - x) % 2^32)
84268452 </pre>
84278453
84288454
84298455
84308456 <p>
8431−<hr><h3><a name="pdf-bit32.OR"><code>bit32.OR (&middot;&middot;&middot;)</code></a></h3>
8457+<hr><h3><a name="pdf-bit32.bor"><code>bit32.bor (&middot;&middot;&middot;)</code></a></h3>
84328458
84338459
84348460 <p>
@@ -8438,7 +8464,7 @@ Returns the bitwise or of its operands. · 3 unmodified lines
84388464
84398465
84408466 <p>
8441−<hr><h3><a name="pdf-bit32.TEST"><code>bit32.TEST (&middot;&middot;&middot;)</code></a></h3>
8467+<hr><h3><a name="pdf-bit32.btest"><code>bit32.btest (&middot;&middot;&middot;)</code></a></h3>
84428468
84438469
84448470 <p>
@@ -8449,7 +8475,7 @@ whether the bitwise and of its operands is different from zero. · 4 unmodified lines
84498475
84508476
84518477 <p>
8452−<hr><h3><a name="pdf-bit32.XOR"><code>bit32.XOR (&middot;&middot;&middot;)</code></a></h3>
8478+<hr><h3><a name="pdf-bit32.bxor"><code>bit32.bxor (&middot;&middot;&middot;)</code></a></h3>
84538479
84548480
84558481 <p>
@@ -8459,7 +8485,7 @@ Returns the bitwise exclusive or of its operands. · 3 unmodified lines
84598485
84608486
84618487 <p>
8462−<hr><h3><a name="pdf-bit32.ROL"><code>bit32.ROL (x, disp)</code></a></h3>
8488+<hr><h3><a name="pdf-bit32.lrotate"><code>bit32.lrotate (x, disp)</code></a></h3>
84638489
84648490
84658491 <p>
@@ -8472,7 +8498,7 @@ For any valid displacement, · 6 unmodified lines
84728498 the following identity holds:
84738499
84748500 <pre>
8475− assert(bit32.ROL(x, disp) == bit32.ROL(x, disp % 32))
8501+ assert(bit32.lrotate(x, disp) == bit32.lrotate(x, disp % 32))
84768502 </pre><p>
84778503 In particular,
84788504 negative displacements rotate to the right.
@@ -8481,75 +8507,53 @@ negative displacements rotate to the right. · 2 unmodified lines
84818507
84828508
84838509 <p>
8484−<hr><h3><a name="pdf-bit32.ROR"><code>bit32.ROR (x, disp)</code></a></h3>
8510+<hr><h3><a name="pdf-bit32.lshift"><code>bit32.lshift (x, disp)</code></a></h3>
84858511
84868512
84878513 <p>
8488−Returns the number <code>x</code> rotated <code>disp</code> bits to the right.
8514+Returns the number <code>x</code> shifted <code>disp</code> bits to the left.
84898515 The number <code>disp</code> may be any representable integer.
8516+Negative displacements shift to the right.
8517+In any direction, vacant bits are filled with zeros.
8518+In particular,
8519+displacements with absolute values higher than 31
8520+result in zero (all bits are shifted out).
84908521
84918522
84928523 <p>
8493−For any valid displacement,
8494−the following identity holds:
8524+For positive displacements,
8525+the following equality holds:
84958526
84968527 <pre>
8497− assert(bit32.ROR(x, disp) == bit32.ROR(x, disp % 32))
8498−</pre><p>
8499−In particular,
8500−negative displacements rotate to the left.
8501−
8528+ assert(bit32.lshift(b, disp) == (b * 2^disp) % 2^32)
8529+</pre>
85028530
85038531
85048532
85058533 <p>
8506−<hr><h3><a name="pdf-bit32.SAR"><code>bit32.SAR (x, disp)</code></a></h3>
8534+<hr><h3><a name="pdf-bit32.rrotate"><code>bit32.rrotate (x, disp)</code></a></h3>
85078535
85088536
85098537 <p>
8510−Returns the number <code>x</code> shifted <code>disp</code> bits to the right.
8538+Returns the number <code>x</code> rotated <code>disp</code> bits to the right.
85118539 The number <code>disp</code> may be any representable integer.
8512−Negative displacements shift to the left.
8513−
8514−
8515−<p>
8516−This shift operation is what is called arithmetic shift.
8517−Vacant bits on the left are filled
8518−with copies of the higher bit of <code>x</code>;
8519−vacant bits on the right are filled with zeros.
8520−In particular,
8521−displacements with absolute values higher than 31
8522−result in zero or <code>0xFFFFFFFF</code> (all bits are shifted out).
8523−
8524−
85258540
85268541
85278542 <p>
8528−<hr><h3><a name="pdf-bit32.SHL"><code>bit32.SHL (x, disp)</code></a></h3>
8529−
8543+For any valid displacement,
8544+the following identity holds:
85308545
8531−<p>
8532−Returns the number <code>x</code> shifted <code>disp</code> bits to the left.
8533−The number <code>disp</code> may be any representable integer.
8534−Negative displacements shift to the right.
8535−In any direction, vacant bits are filled with zeros.
8546+<pre>
8547+ assert(bit32.rrotate(x, disp) == bit32.rrotate(x, disp % 32))
8548+</pre><p>
85368549 In particular,
8537−displacements with absolute values higher than 31
8538−result in zero (all bits are shifted out).
8539−
8540−
8541−<p>
8542−For positive displacements,
8543−the following equality holds:
8550+negative displacements rotate to the left.
85448551
8545−<pre>
8546− assert(bit32.SHL(b, disp) == (b * 2^disp) % 2^32)
8547−</pre>
85488552
85498553
85508554
85518555 <p>
8552−<hr><h3><a name="pdf-bit32.SHR"><code>bit32.SHR (x, disp)</code></a></h3>
8556+<hr><h3><a name="pdf-bit32.rshift"><code>bit32.rshift (x, disp)</code></a></h3>
85538557
85548558
85558559 <p>
@@ -8567,7 +8571,7 @@ For positive displacements, · 11 unmodified lines
85678571 the following equality holds:
85688572
85698573 <pre>
8570− assert(bit32.SHR(b, disp) == math.floor(b % 2^32 / 2^disp))
8574+ assert(bit32.rshift(b, disp) == math.floor(b % 2^32 / 2^disp))
85718575 </pre>
85728576
85738577 <p>
@@ -9925,7 +9929,7 @@ Here is the complete syntax of Lua in extended BNF. · 1351 unmodified lines
99259929 <HR>
99269930 <SMALL>
99279931 Last update:
9928−Wed Nov 17 14:49:08 BRST 2010
9932+Mon Nov 22 16:36:19 BRST 2010
99299933 </SMALL>
99309934 <!--
99319935 Last change: revised for Lua 5.2.0 (alpha)
doc/readme.html+3−3
@@ -81,7 +81,7 @@ distributed in this package. · 80 unmodified lines
8181
8282 <P>
8383 Lua is distributed in
84−<A HREF="ftp/">source</A>
84+<A HREF="http://www.lua.org/ftp/">source</A>
8585 form.
8686 You need to build it before using it.
8787 Building Lua should be straightforward
@@ -354,7 +354,7 @@ Here are the other changes introduced in Lua 5.2: · 266 unmodified lines
354354 Lua is free software distributed under the terms of the
355355 <A HREF="http://www.opensource.org/licenses/mit-license.html">MIT license</A>
356356 reproduced below;
357−it can be used for any purpose, including commercial purposes,
357+it may be used for any purpose, including commercial purposes,
358358 at absolutely no cost without having to ask us.
359359
360360 The only requirement is that if you do use Lua,
@@ -391,7 +391,7 @@ THE SOFTWARE. · 30 unmodified lines
391391 <HR>
392392 <SMALL>
393393 Last update:
394−Thu Nov 11 15:16:22 BRST 2010
394+Sat Nov 20 19:23:14 BRST 2010
395395 </SMALL>
396396 <!--
397397 Last change: revised for Lua 5.2.0 (alpha)
src/lbitlib.c+13−13
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lbitlib.c,v 1.11 2010/11/08 16:31:22 roberto Exp $
2+** $Id: lbitlib.c,v 1.13 2010/11/22 18:06:33 roberto Exp $
33 ** Standard library for bitwise operations
44 ** See Copyright Notice in lua.h
55 */
@@ -130,27 +130,27 @@ static int b_rot (lua_State *L, int i) { · 124 unmodified lines
130130 }
131131
132132
133−static int b_rol (lua_State *L) {
133+static int b_lrot (lua_State *L) {
134134 return b_rot(L, luaL_checkint(L, 2));
135135 }
136136
137137
138−static int b_ror (lua_State *L) {
138+static int b_rrot (lua_State *L) {
139139 return b_rot(L, -luaL_checkint(L, 2));
140140 }
141141
142142
143143 static const luaL_Reg bitlib[] = {
144− {"AND", b_and},
145− {"TEST", b_test},
146− {"OR", b_or},
147− {"XOR", b_xor},
148− {"NOT", b_not},
149− {"SHL", b_lshift},
150− {"SAR", b_arshift},
151− {"SHR", b_rshift},
152− {"ROL", b_rol},
153− {"ROR", b_ror},
144+ {"arshift", b_arshift},
145+ {"band", b_and},
146+ {"bnot", b_not},
147+ {"bor", b_or},
148+ {"bxor", b_xor},
149+ {"lrotate", b_lrot},
150+ {"lshift", b_lshift},
151+ {"rrotate", b_rrot},
152+ {"rshift", b_rshift},
153+ {"btest", b_test},
154154 {NULL, NULL}
155155 };
156156
src/llex.c+2−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: llex.c,v 2.40 2010/10/25 12:24:36 roberto Exp $
2+** $Id: llex.c,v 2.41 2010/11/18 18:38:44 roberto Exp $
33 ** Lexical Analyzer
44 ** See Copyright Notice in lua.h
55 */
@@ -471,10 +471,10 @@ static int llex (LexState *ls, SemInfo *seminfo) { · 465 unmodified lines
471471 } while (lislalnum(ls->current));
472472 ts = luaX_newstring(ls, luaZ_buffer(ls->buff),
473473 luaZ_bufflen(ls->buff));
474+ seminfo->ts = ts;
474475 if (ts->tsv.reserved > 0) /* reserved word? */
475476 return ts->tsv.reserved - 1 + FIRST_RESERVED;
476477 else {
477− seminfo->ts = ts;
478478 return TK_NAME;
479479 }
480480 }
src/lmathlib.c+5−4
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lmathlib.c,v 1.78 2010/11/12 15:47:34 roberto Exp $
2+** $Id: lmathlib.c,v 1.79 2010/11/18 18:38:27 roberto Exp $
33 ** Standard mathematical library
44 ** See Copyright Notice in lua.h
55 */
@@ -136,11 +136,12 @@ static int math_log (lua_State *L) { · 130 unmodified lines
136136
137137 static int math_log10 (lua_State *L) {
138138 #if !defined(LUA_COMPAT_LOG10)
139− luaL_error(L, "function " LUA_QL("log10")
140− " is deprecated; use log(x, 10) instead");
141−#endif
139+ return luaL_error(L, "function " LUA_QL("log10")
140+ " is deprecated; use log(x, 10) instead");
141+#else
142142 lua_pushnumber(L, l_tg(log10)(luaL_checknumber(L, 1)));
143143 return 1;
144+#endif
144145 }
145146
146147 static int math_exp (lua_State *L) {
src/lstrlib.c+1−8
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lstrlib.c,v 1.158 2010/11/16 20:39:41 roberto Exp $
2+** $Id: lstrlib.c,v 1.159 2010/11/19 16:25:51 roberto Exp $
33 ** Standard library for string operations and pattern-matching
44 ** See Copyright Notice in lua.h
55 */
@@ -614,12 +614,6 @@ static int gmatch (lua_State *L) { · 608 unmodified lines
614614 }
615615
616616
617−static int gfind_nodef (lua_State *L) {
618− return luaL_error(L, LUA_QL("string.gfind") " was renamed to "
619− LUA_QL("string.gmatch"));
620−}
621−
622−
623617 static void add_s (MatchState *ms, luaL_Buffer *b, const char *s,
624618 const char *e) {
625619 size_t l, i;
@@ -912,7 +906,6 @@ static const luaL_Reg strlib[] = { · 286 unmodified lines
912906 {"dump", str_dump},
913907 {"find", str_find},
914908 {"format", str_format},
915− {"gfind", gfind_nodef},
916909 {"gmatch", gmatch},
917910 {"gsub", str_gsub},
918911 {"len", str_len},