Imported from ../lua-5.0.1.tar.gz.
[lua.git] / DIFFS
blob006a274829fe6186a1d0ef70503fc35f7fc17ded
1 diff -r lua-5.0/doc/manual.html lua-5.0.1/doc/manual.html
2 5c5
3 < <title>Lua 5.0 Reference Manual</title>
4 ---
5 > <TITLE>Lua: 5.0 reference manual</TITLE>
6 12,14c12
7 < <a HREF="http://www.lua.org/home.html">
8 < <img SRC="logo.gif" ALT="[Lua logo]" BORDER=0>
9 < </a>
10 ---
11 > <A HREF="http://www.lua.org/home.html"><IMG SRC="logo.gif" ALT="Lua" BORDER=0></A>
12 22c20
13 < &copy; 2003 TeCGraf, PUC-Rio.  All rights reserved.
14 ---
15 > &copy; 2003 Tecgraf, PUC-Rio.  All rights reserved.
16 32c30
17 < <h1>1 - Introduction</h1>
18 ---
19 > <a name="1"><h1>1 - Introduction</h1></a>
20 37c35
21 < It also offers good suport for object-oriented programming,
22 ---
23 > It also offers good support for object-oriented programming,
24 54c52
25 < <p>The Lua distribuition includes a stand-alone embedding program,
26 ---
27 > <p>The Lua distribution includes a stand-alone embedding program,
28 90c88
29 < <a name="language"><h1>2 - The Language</h1></a>
30 ---
31 > <a name="language"><a name="2"><h1>2 - The Language</h1></a></a>
32 108c106
33 < <p><a name="lexical"><h2>2.1 - Lexical Conventions</h2></a>
34 ---
35 > <p><a name="lexical"><a name="2.1"><h2>2.1 - Lexical Conventions</h2></a></a>
36 125,126c123
37 <        repeat    return    then      true      until
38 <        while
39 ---
40 >        repeat    return    then      true      until     while
41 214c211
42 < <p><a name="TypesSec"><h2>2.2 - Values and Types</h2></a>
43 ---
44 > <p><a name="TypesSec"><a name="2.2"><h2>2.2 - Values and Types</h2></a></a>
45 295c292
46 < <p><a name="coercion"><h3>2.2.1 - Coercion</h3></a>
47 ---
48 > <p><a name="coercion"><a name="2.2.1"><h3>2.2.1 - Coercion</h3></a></a>
49 306c303
50 < <p><a name="variables"><h2>2.3 - Variables</h2></a>
51 ---
52 > <p><a name="variables"><a name="2.3"><h2>2.3 - Variables</h2></a></a>
53 375c372
54 < <p><a name="stats"><h2>2.4 - Statements</h2></a>
55 ---
56 > <p><a name="stats"><a name="2.4"><h2>2.4 - Statements</h2></a></a>
57 383c380
58 < <p><a name="chunks"><h3>2.4.1 - Chunks</h3></a>
59 ---
60 > <p><a name="chunks"><a name="2.4.1"><h3>2.4.1 - Chunks</h3></a></a>
61 408c405
62 < <p><h3>2.4.2 - Blocks</h3>
63 ---
64 > <p><a name="2.4.2"><h3>2.4.2 - Blocks</h3></a>
65 426c423
66 < <p><a name="assignment"><h3>2.4.3 - Assignment</h3></a>
67 ---
68 > <p><a name="assignment"><a name="2.4.3"><h3>2.4.3 - Assignment</h3></a></a>
69 461c458
70 < before it is assigned 4.
71 ---
72 > before it is assigned&nbsp;4.
73 488c485
74 < <p><a name="control"><h3>2.4.4 - Control Structures</h3></a>
75 ---
76 > <p><a name="control"><a name="2.4.4"><h3>2.4.4 - Control Structures</h3></a></a>
77 519c516
78 < skiping to the next statement after the loop:
79 ---
80 > skipping to the next statement after the loop:
81 539c536
82 < <p><a name="for"><h3>2.4.5 - For Statement</h3></a>
83 ---
84 > <p><a name="for"><a name="2.4.5"><h3>2.4.5 - For Statement</h3></a></a>
85 626c623
86 < <p><a name="funcstat"><h3>2.4.6 - Function Calls as Statements</h3></a>
87 ---
88 > <p><a name="funcstat"><a name="2.4.6"><h3>2.4.6 - Function Calls as Statements</h3></a></a>
89 635c632
90 < <p><a name="localvar"><h3>2.4.7 - Local Declarations</h3></a>
91 ---
92 > <p><a name="localvar"><a name="2.4.7"><h3>2.4.7 - Local Declarations</h3></a></a>
93 652c649
94 < <p><a name="expressions"><h2>2.5 - Expressions</h2></a>
95 ---
96 > <p><a name="expressions"><a name="2.5"><h2>2.5 - Expressions</h2></a></a>
97 683c680
98 < <p><h3>2.5.1 - Arithmetic Operators</h3>
99 ---
100 > <p><a name="2.5.1"><h3>2.5.1 - Arithmetic Operators</h3></a>
101 698c695
102 < <p><a name="rel-ops"><h3>2.5.2 - Relational Operators</h3></a>
104 > <p><a name="rel-ops"><a name="2.5.2"><h3>2.5.2 - Relational Operators</h3></a></a>
105 734c731
106 < <p><h3>2.5.3 - Logical Operators</h3>
108 > <p><a name="2.5.3"><h3>2.5.3 - Logical Operators</h3></a>
109 767c764
110 < <p><a name="concat"><h3>2.5.4 - Concatenation</h3></a>
112 > <p><a name="concat"><a name="2.5.4"><h3>2.5.4 - Concatenation</h3></a></a>
113 774c771
114 < <p><h3>2.5.5 - Precedence</h3>
116 > <p><a name="2.5.5"><h3>2.5.5 - Precedence</h3></a>
117 787c784
118 < As usual, you can use parentheses to change the precedences of an expression.
120 > You can use parentheses to change the precedences in an expression.
121 792c789
122 < <p><a name="tableconstructor"><h3>2.5.6 - Table Constructors</h3></a>
124 > <p><a name="tableconstructor"><a name="2.5.6"><h3>2.5.6 - Table Constructors</h3></a></a>
125 842c839
126 < <p><a name="functioncall"><h3>2.5.7 - Function Calls</h3></a>
128 > <p><a name="functioncall"><a name="2.5.7"><h3>2.5.7 - Function Calls</h3></a></a>
129 947c944
130 <   return x, f(x)       -- adicional results
132 >   return x, f(x)       -- additional results
133 952c949
134 < <p><a name="func-def"><h3>2.5.8 - Function Definitions</h3></a>
136 > <p><a name="func-def"><a name="2.5.8"><h3>2.5.8 - Function Definitions</h3></a></a>
137 1061c1058
138 < <p><a name="visibility"><h2>2.6 - Visibility Rules</h2></a>
140 > <p><a name="visibility"><a name="2.6"><h2>2.6 - Visibility Rules</h2></a></a>
141 1118c1115
142 < <p><a name="error"><h2>2.7 - Error Handling</h2></a>
144 > <p><a name="error"><a name="2.7"><h2>2.7 - Error Handling</h2></a></a>
145 1133c1130
146 < <p><a name="metatable"><h2>2.8 - Metatables</h2></a>
148 > <p><a name="metatable"><a name="2.8"><h2>2.8 - Metatables</h2></a></a>
149 1315c1312
150 <    if type(op1) ~= type(op2) then  -- diferent types?
152 >    if type(op1) ~= type(op2) then  -- different types?
153 1443c1440
154 < <p><a name="GC"><h2>2.9 - Garbage Collection</h2></a>
156 > <p><a name="GC"><a name="2.9"><h2>2.9 - Garbage Collection</h2></a></a>
157 1474c1471
158 < <p><h3>2.9.1 - Garbage-Collection Metamethods</h3>
160 > <p><a name="2.9.1"><h3>2.9.1 - Garbage-Collection Metamethods</h3></a>
161 1506c1503
162 < <p><a name="weak-table"><h3>2.9.2 - Weak Tables</h3></a>
164 > <p><a name="weak-table"><a name="2.9.2"><h3>2.9.2 - Weak Tables</h3></a></a>
165 1524c1521
166 < If the <code>__mode</code> field is a string containing the character `<code>k</code>&acute;,
168 > If the <code>__mode</code> field is a string containing the character&nbsp;`<code>k</code>&acute;,
169 1534c1531
170 < <p><a name="coroutine"><h2>2.10 - Coroutines</h2></a>
172 > <p><a name="coroutine"><a name="2.10"><h2>2.10 - Coroutines</h2></a></a>
173 1552c1549
174 < passing as argument the thread returned by <code>coroutine.create</code>,
176 > passing as its first argument the thread returned by <code>coroutine.create</code>,
177 1633c1630
178 < <a name="API"><h1>3 - The Application Program Interface</h1></a>
180 > <a name="API"><a name="3"><h1>3 - The Application Program Interface</h1></a></a>
181 1648c1645
182 < <p><a name="mangstate"><h2>3.1 - States</h2></a>
184 > <p><a name="mangstate"><a name="3.1"><h2>3.1 - States</h2></a></a>
185 1684c1681
186 < <p><h2>3.2 - The Stack and Indices</h2>
188 > <p><a name="3.2"><h2>3.2 - The Stack and Indices</h2></a>
189 1694c1691
190 < and it is where the C function pushes its results (see <a href="#LuacallC">3.16</a>)
192 > and it is where the C function pushes its results to be returned to the caller (see <a href="#LuacallC">3.16</a>)
193 1739c1736
194 < it ensures that at least <code>LUA_MINSTACK</code> positions are available.
196 > it ensures that at least <code>LUA_MINSTACK</code> stack positions are available.
197 1763c1760
198 < <p><h2>3.3 - Stack Manipulation</h2>
200 > <p><a name="3.3"><h2>3.3 - Stack Manipulation</h2></a>
201 1816c1813
202 < <p><h2>3.4 - Querying the Stack</h2>
204 > <p><a name="3.4"><h2>3.4 - Querying the Stack</h2></a>
205 1890c1887
206 < <p><a name="lua-to"><h2>3.5 - Getting Values from the Stack</h2></a>
208 > <p><a name="lua-to"><a name="3.5"><h2>3.5 - Getting Values from the Stack</h2></a></a>
209 1969c1966
210 < <p><a name="pushing"><h2>3.6 - Pushing Values onto the Stack</h2></a>
212 > <p><a name="pushing"><a name="3.6"><h2>3.6 - Pushing Values onto the Stack</h2></a></a>
213 1999,2000c1996
214 <        const char *lua_pushvfstring (lua_State *L, const char *fmt,
215 <                                                    va_list argp);
217 >        const char *lua_pushvfstring (lua_State *L, const char *fmt, va_list argp);
218 2028c2024
219 < If <code>n</code> is 1, the result is that single string
221 > If <code>n</code>&nbsp;is&nbsp;1, the result is that single string
222 2034c2030
223 < <p><a name="GC-API"><h2>3.7 - Controlling Garbage Collection</h2></a>
225 > <p><a name="GC-API"><a name="3.7"><h2>3.7 - Controlling Garbage Collection</h2></a></a>
226 2047c2043
227 <        int  lua_getgccount (lua_State *L);
229 >        int  lua_getgccount     (lua_State *L);
230 2067c2063
231 < <p><a name="userdata"><h2>3.8 - Userdata</h2></a>
233 > <p><a name="userdata"><a name="3.8"><h2>3.8 - Userdata</h2></a></a>
234 2112c2108
235 < <p><h2>3.9 - Metatables</h2>
237 > <p><a name="3.9"><h2>3.9 - Metatables</h2></a>
238 2133c2129
239 < <p><h2>3.10 - Loading Lua Chunks</h2>
241 > <p><a name="3.10"><h2>3.10 - Loading Lua Chunks</h2></a>
242 2160c2156
243 < <p><code>lua_load</code> uses an user-supplied <em>reader</em> function to read the chunk.
245 > <p><code>lua_load</code> uses a user-supplied <em>reader</em> function to read the chunk.
246 2162c2158
247 < it calls the reader,
249 > <code>lua_load</code> calls the reader,
250 2182c2178
251 < <p><h2>3.11 - Manipulating Tables</h2>
253 > <p><a name="3.11"><h2>3.11 - Manipulating Tables</h2></a>
254 2263c2259
255 < <p><a name="globals"><h2>3.12 - Manipulating Environments</h2></a>
257 > <p><a name="globals"><a name="3.12"><h2>3.12 - Manipulating Environments</h2></a></a>
258 2295c2291
259 < <p><h2>3.13 - Using Tables as Arrays</h2>
261 > <p><a name="3.13"><h2>3.13 - Using Tables as Arrays</h2></a>
262 2312c2308
263 < <p><h2>3.14 - Calling Functions</h2>
265 > <p><a name="3.14"><h2>3.14 - Calling Functions</h2></a>
266 2367c2363
267 < <p><a name="lua_pcall"><h2>3.15 - Protected Calls</h2></a>
269 > <p><a name="lua_pcall"><a name="3.15"><h2>3.15 - Protected Calls</h2></a></a>
270 2414c2410
271 < <p><a name="LuacallC"><h2>3.16 - Defining C Functions</h2></a>
273 > <p><a name="LuacallC"><a name="3.16"><h2>3.16 - Defining C Functions</h2></a></a>
274 2482c2478
275 < <p><a name="c-closure"><h2>3.17 - Defining C Closures</h2></a>
277 > <p><a name="c-closure"><a name="3.17"><h2>3.17 - Defining C Closures</h2></a></a>
278 2517c2513
279 < <p><a name="registry"><h2>3.18 - Registry</h2></a>
281 > <p><a name="registry"><a name="3.18"><h2>3.18 - Registry</h2></a></a>
282 2535c2531
283 < <p><h2>3.19 - Error Handling in C</h2>
285 > <p><a name="3.19"><h2>3.19 - Error Handling in C</h2></a>
286 2542,2543c2538,2539
287 < to set a recover point,
288 < and any error jumps to the most recent active recover point.
290 > to set a recover point;
291 > any error jumps to the most recent active recover point.
292 2546c2542
293 < Lua calls a <em>panic function</em>,
295 > Lua calls a <em>panic function</em>
296 2553,2554c2549,2550
297 < never returning (e.g. doing a long jump).
298 < Nevertheless, the corresponding Lua will not be consistent;
300 > never returning (e.g., by doing a long jump).
301 > Nevertheless, the corresponding Lua state will not be consistent;
302 2578c2574
303 < Any value returned by <code>func</code> is dicarded.
305 > Any value returned by <code>func</code> is discarded.
306 2590c2586
307 < <p><h2>3.20 - Threads</h2>
309 > <p><a name="3.20"><h2>3.20 - Threads</h2></a>
310 2611,2616c2607,2609
311 < <p>You destroy threads with <code>lua_closethread</code>:
312 < <PRE>
313 <        void lua_closethread (lua_State *L, lua_State *thread);
314 < </PRE>
315 < You cannot close the sole (or last) thread of a state.
316 < Instead, you must close the state itself.
318 > <p>There is no explicit function to close or to destroy a thread.
319 > Threads are subject to garbage collection,
320 > like any Lua object.
321 2622c2615
322 <        int lua_yield (lua_State *L, int nresults);
324 >        int lua_yield  (lua_State *L, int nresults);
325 2632c2625
326 < <code>lua_resume</code> returns 0 if there is no errors running the coroutine,
328 > <code>lua_resume</code> returns 0 if there are no errors running the coroutine,
329 2660c2653
330 < <a name="debugI"><h1>4 - The Debug Interface</h1></a>
332 > <a name="debugI"><a name="4"><h1>4 - The Debug Interface</h1></a></a>
333 2669c2662
334 < <p><h2>4.1 - Stack and Function Information</h2>
336 > <p><a name="4.1"><h2>4.1 - Stack and Function Information</h2></a>
337 2681c2674
338 < When there is no errors, <code>lua_getstack</code> returns 1;
340 > When there are no errors, <code>lua_getstack</code> returns 1;
341 2789c2782
342 < <p><h2>4.2 - Manipulating Local Variables and Upvalues</h2>
344 > <p><a name="4.2"><h2>4.2 - Manipulating Local Variables and Upvalues</h2></a>
345 2866c2859
346 < <p><a name="sub-hooks"><h2>4.3 - Hooks</h2></a>
348 > <p><a name="sub-hooks"><a name="4.3"><h2>4.3 - Hooks</h2></a></a>
349 2942c2935
350 < <a name="libraries"><h1>5 - Standard Libraries</h1></a>
352 > <a name="libraries"><a name="5"><h1>5 - Standard Libraries</h1></a></a>
353 2985c2978
354 < <p><a name="predefined"><h2>5.1 - Basic Functions</h2></a>
356 > <p><a name="predefined"><a name="5.1"><h2>5.1 - Basic Functions</h2></a></a>
357 3018c3011
358 < Terminates the last protected function called,
360 > Terminates the last protected function called
361 3046c3039
362 < <p>if the environment has a <code>"__fenv"</code> field,
364 > <p>If the environment has a <code>"__fenv"</code> field,
365 3151c3144
366 < That means that any error inside <code>f</code> is not propagated;
368 > That means that any error inside&nbsp;<code>f</code> is not propagated;
369 3155c3148
370 < which is true if the call succeeds without errors.
372 > which is <B>true</B> if the call succeeds without errors.
373 3330c3323
374 < <p><h2>5.2 - Coroutine Manipulation</h2>
376 > <p><a name="5.2"><h2>5.2 - Coroutine Manipulation</h2></a>
377 3333c3326
378 < the basic library, and come inside the table .
380 > the basic library and come inside the table <code>coroutine</code>.
381 3388c3381
382 < <p><h2>5.3 - String Manipulation</h2>
384 > <p><a name="5.3"><h2>5.3 - String Manipulation</h2></a>
385 3595c3588
386 < a <em>character class</em> is used to represent a set of characters.
388 > A <em>character class</em> is used to represent a set of characters.
389 3651c3644
390 < a <em>pattern item</em> may be
392 > A <em>pattern item</em> may be
393 3688c3681
394 < a <em>pattern</em> is a sequence of pattern items.
396 > A <em>pattern</em> is a sequence of pattern items.
397 3715c3708
398 < <p><h2>5.4 - Table Manipulation</h2>
400 > <p><a name="5.4"><h2>5.4 - Table Manipulation</h2></a>
401 3824c3817
402 < <p><a name="mathlib"><h2>5.5 - Mathematical Functions</h2></a>
404 > <p><a name="mathlib"><a name="5.5"><h2>5.5 - Mathematical Functions</h2></a></a>
405 3879c3872
406 < <p><a name="libio"><h2>5.6 - Input and Output Facilities</h2></a>
408 > <p><a name="libio"><a name="5.6"><h2>5.6 - Input and Output Facilities</h2></a></a>
409 4072c4065
410 < <p><a name="libiosys"><h2>5.7 - Operating System Facilities</h2></a>
412 > <p><a name="libiosys"><a name="5.7"><h2>5.7 - Operating System Facilities</h2></a></a>
413 4098c4091
414 < <code>wday</code> (weekday, Sunday is 1),
416 > <code>wday</code> (weekday, Sunday is&nbsp;1),
417 4187c4180
418 < <p><h2>5.8 - The Reflexive Debug Interface</h2>
420 > <p><a name="5.8"><h2>5.8 - The Reflexive Debug Interface</h2></a>
421 4323c4316
422 < <a name="lua-sa"><h1>6 - Lua Stand-alone</h1></a>
424 > <a name="lua-sa"><a name="6"><h1>6 - Lua Stand-alone</h1></a></a>
425 4462c4455
426 < Vincent Penquerc'h,
428 > Vincent Penquerc'h.
429 4583c4576
430 < <p>   exp ::=  <b>nil</b> <b>false</b> <b>true</b> | Number | Literal | function | prefixexp | tableconstructor | exp binop exp | unop exp 
432 > <p>   exp ::=  <b>nil</b> | <b>false</b> | <b>true</b> | Number | Literal | function | prefixexp | tableconstructor | exp binop exp | unop exp 
433 4612c4605,4609
434 < </body></html>
436 > <HR>
437 > <SMALL>
438 > Last update:
439 > Tue Nov 25 16:08:37 BRST 2003
440 > </SMALL>
441 4613a4611,4612
442 > </BODY>
443 > </HTML>
444 diff -r lua-5.0/include/lua.h lua-5.0.1/include/lua.h
446 < ** $Id: lua.h,v 1.175 2003/03/18 12:31:39 roberto Exp $
448 > ** $Id: lua.h,v 1.175a 2003/03/18 12:31:39 roberto Exp $
449 17c17
450 < #define LUA_VERSION   "Lua 5.0"
452 > #define LUA_VERSION   "Lua 5.0.1"
453 diff -r lua-5.0/src/ldo.c lua-5.0.1/src/ldo.c
455 < ** $Id: ldo.c,v 1.217 2003/04/03 13:35:34 roberto Exp $
457 > ** $Id: ldo.c,v 1.217a 2003/04/03 13:35:34 roberto Exp $
458 325,326c325
459 <     if (nargs >= L->top - L->base)
460 <       luaG_runerror(L, "cannot resume dead coroutine");
462 >     lua_assert(nargs < L->top - L->base);
463 329c328,329
464 <   else if (ci->state & CI_YIELD) {  /* inside a yield? */
466 >   else {  /* inside a yield */
467 >     lua_assert(ci->state & CI_YIELD);
468 344,345d343
469 <   else
470 <     luaG_runerror(L, "cannot resume non-suspended coroutine");
471 351a350,358
472 > static int resume_error (lua_State *L, const char *msg) {
473 >   L->top = L->ci->base;
474 >   setsvalue2s(L->top, luaS_new(L, msg));
475 >   incr_top(L);
476 >   lua_unlock(L);
477 >   return LUA_ERRRUN;
478 > }
481 355a363,368
482 >   if (L->ci == L->base_ci) {
483 >     if (nargs >= L->top - L->base)
484 >       return resume_error(L, "cannot resume dead coroutine");
485 >   }
486 >   else if (!(L->ci->state & CI_YIELD))  /* not inside a yield? */
487 >     return resume_error(L, "cannot resume non-suspended coroutine");
488 diff -r lua-5.0/src/lgc.c lua-5.0.1/src/lgc.c
490 < ** $Id: lgc.c,v 1.171 2003/04/03 13:35:34 roberto Exp $
492 > ** $Id: lgc.c,v 1.171a 2003/04/03 13:35:34 roberto Exp $
493 113c113,114
494 < void luaC_separateudata (lua_State *L) {
496 > size_t luaC_separateudata (lua_State *L) {
497 >   size_t deadmem = 0;
498 127a129
499 >       deadmem += sizeudata(gcotou(curr)->uv.len);
500 136a139
501 >   return deadmem;
502 247c250
503 <     if (!(ci->state & CI_C) && lim < ci->top)
505 >     if (lim < ci->top)
506 390c393
507 < static void checkSizes (lua_State *L) {
509 > static void checkSizes (lua_State *L, size_t deadmem) {
510 400c403
511 <   G(L)->GCthreshold = 2*G(L)->nblocks;  /* new threshold */
513 >   G(L)->GCthreshold = 2*G(L)->nblocks - deadmem;  /* new threshold */
514 454c457,458
515 < static void mark (lua_State *L) {
517 > static size_t mark (lua_State *L) {
518 >   size_t deadmem;
519 467c471
520 <   luaC_separateudata(L);  /* separate userdata to be preserved */
522 >   deadmem = luaC_separateudata(L);  /* separate userdata to be preserved */
523 475a480
524 >   return deadmem;
525 480c485
526 <   mark(L);
528 >   size_t deadmem = mark(L);
529 482c487
530 <   checkSizes(L);
532 >   checkSizes(L, deadmem);
533 diff -r lua-5.0/src/lgc.h lua-5.0.1/src/lgc.h
535 < ** $Id: lgc.h,v 1.19 2003/02/28 19:45:15 roberto Exp $
537 > ** $Id: lgc.h,v 1.19a 2003/02/28 19:45:15 roberto Exp $
538 18c18
539 < void luaC_separateudata (lua_State *L);
541 > size_t luaC_separateudata (lua_State *L);
542 diff -r lua-5.0/src/lib/lbaselib.c lua-5.0.1/src/lib/lbaselib.c
544 < ** $Id: lbaselib.c,v 1.130 2003/04/03 13:35:34 roberto Exp $
546 > ** $Id: lbaselib.c,v 1.130a 2003/04/03 13:35:34 roberto Exp $
547 327c327
548 <   char buff[64];
550 >   char buff[128];
551 diff -r lua-5.0/src/lib/liolib.c lua-5.0.1/src/lib/liolib.c
553 < ** $Id: liolib.c,v 2.39 2003/03/19 21:16:12 roberto Exp $
555 > ** $Id: liolib.c,v 2.39a 2003/03/19 21:16:12 roberto Exp $
556 161c161
557 <   if (lua_isnone(L, 1)) {
559 >   if (lua_isnone(L, 1) && lua_type(L, lua_upvalueindex(1)) == LUA_TTABLE) {
560 178c178
561 <   char buff[32];
563 >   char buff[128];
564 diff -r lua-5.0/src/lparser.c lua-5.0.1/src/lparser.c
566 < ** $Id: lparser.c,v 1.208 2003/04/03 13:35:34 roberto Exp $
568 > ** $Id: lparser.c,v 1.208a 2003/04/03 13:35:34 roberto Exp $
569 1143a1144
570 >   FuncState *fs = ls->fs;
571 1145c1146,1147
572 <   init_exp(&v, VLOCAL, ls->fs->freereg++);
574 >   init_exp(&v, VLOCAL, fs->freereg);
575 >   luaK_reserveregs(fs, 1);
576 1148c1150,1152
577 <   luaK_storevar(ls->fs, &v, &b);
579 >   luaK_storevar(fs, &v, &b);
580 >   /* debug information will only see the variable after this point! */
581 >   getlocvar(fs, fs->nactvar - 1).startpc = fs->pc;
582 diff -r lua-5.0/src/luac/Makefile lua-5.0.1/src/luac/Makefile
583 16c16
584 <       $(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS)
586 >       $(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS) $(DLLIB)
587 diff -r lua-5.0/src/luac/luac.c lua-5.0.1/src/luac/luac.c
589 < ** $Id: luac.c,v 1.44 2003/04/07 20:34:20 lhf Exp $
591 > ** $Id: luac.c,v 1.44a 2003/04/07 20:34:20 lhf Exp $
592 184a185
593 >   lua_lock(L);
594 185a187
595 >   lua_unlock(L);
596 diff -r lua-5.0/src/lvm.c lua-5.0.1/src/lvm.c
598 < ** $Id: lvm.c,v 1.284 2003/04/03 13:35:34 roberto Exp $
600 > ** $Id: lvm.c,v 1.284a 2003/04/03 13:35:34 roberto Exp $
601 69c69
602 <   if (mask > LUA_MASKLINE) {  /* instruction-hook set? */
604 >   if (mask & LUA_MASKCOUNT) {  /* instruction-hook set? */
605 402d401
606 <   L->ci->u.l.pc = &pc;
607 405a405
608 >   L->ci->u.l.pc = &pc;
609 676,678c676
610 <           lua_assert(ci->u.l.pc == &pc &&
611 <                      ttisfunction(ci->base - 1) &&
612 <                      (ci->state & CI_SAVEDPC));
614 >           lua_assert(ttisfunction(ci->base - 1) && (ci->state & CI_SAVEDPC));
615 diff -r lua-5.0/test/luac.lua lua-5.0.1/test/luac.lua
616 4,6c4,6
617 < assert(arg[1]~=nil,"usage: lua luac.lua file.lua")
618 < f=assert(io.open("luac.out","w"))
619 < f:write(string.dump(loadfile(arg[1])))
621 > assert(arg[1]~=nil and arg[2]==nil,"usage: lua luac.lua file.lua")
622 > f=assert(io.open("luac.out","wb"))
623 > f:write(string.dump(assert(loadfile(arg[1]))))