Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/LUA]: src/external/mit/lua/dist initial import of lua 5.4.6
details: https://anonhg.NetBSD.org/src/rev/1b5dead35449
branches: LUA
changeset: 376135:1b5dead35449
user: nikita <nikita%NetBSD.org@localhost>
date: Fri Jun 02 14:13:25 2023 +0000
description:
initial import of lua 5.4.6
diffstat:
external/mit/lua/dist/Makefile | 4 +-
external/mit/lua/dist/README | 2 +-
external/mit/lua/dist/doc/contents.html | 12 +-
external/mit/lua/dist/doc/lua.1 | 18 +-
external/mit/lua/dist/doc/manual.html | 311 ++++++++++++++++++++-----------
external/mit/lua/dist/doc/readme.html | 13 +-
external/mit/lua/dist/src/Makefile | 5 +-
external/mit/lua/dist/src/lapi.c | 251 ++++++++++++-------------
external/mit/lua/dist/src/lapi.h | 19 +-
external/mit/lua/dist/src/lauxlib.c | 58 +++--
external/mit/lua/dist/src/lcode.c | 139 +++++++++-----
external/mit/lua/dist/src/lcorolib.c | 6 +-
external/mit/lua/dist/src/ldebug.c | 82 ++++---
external/mit/lua/dist/src/ldebug.h | 4 +-
external/mit/lua/dist/src/ldo.c | 231 +++++++++++++----------
external/mit/lua/dist/src/ldo.h | 19 +-
external/mit/lua/dist/src/ldump.c | 10 +-
external/mit/lua/dist/src/lfunc.c | 56 ++--
external/mit/lua/dist/src/lfunc.h | 8 +-
external/mit/lua/dist/src/lgc.c | 108 +++++-----
external/mit/lua/dist/src/lgc.h | 21 +-
external/mit/lua/dist/src/llex.c | 8 +-
external/mit/lua/dist/src/llimits.h | 23 +-
external/mit/lua/dist/src/lmathlib.c | 12 +-
external/mit/lua/dist/src/lmem.c | 70 ++++--
external/mit/lua/dist/src/loadlib.c | 11 +-
external/mit/lua/dist/src/lobject.c | 40 ++-
external/mit/lua/dist/src/lobject.h | 21 +-
external/mit/lua/dist/src/lopcodes.h | 4 +-
external/mit/lua/dist/src/loslib.c | 40 +--
external/mit/lua/dist/src/lparser.c | 33 +-
external/mit/lua/dist/src/lstate.c | 67 +++---
external/mit/lua/dist/src/lstate.h | 27 +-
external/mit/lua/dist/src/lstrlib.c | 4 +-
external/mit/lua/dist/src/ltable.c | 10 +-
external/mit/lua/dist/src/ltable.h | 3 +-
external/mit/lua/dist/src/ltablib.c | 4 +-
external/mit/lua/dist/src/ltm.c | 40 ++--
external/mit/lua/dist/src/ltm.h | 7 +-
external/mit/lua/dist/src/lua.c | 41 ++-
external/mit/lua/dist/src/lua.h | 29 +-
external/mit/lua/dist/src/luac.c | 8 +-
external/mit/lua/dist/src/luaconf.h | 15 +-
external/mit/lua/dist/src/lundump.c | 10 +-
external/mit/lua/dist/src/lutf8lib.c | 29 +-
external/mit/lua/dist/src/lvm.c | 237 +++++++++++++++---------
external/mit/lua/dist/src/lvm.h | 7 +-
47 files changed, 1269 insertions(+), 908 deletions(-)
diffs (truncated from 5594 to 300 lines):
diff -r 8fdce1000ba3 -r 1b5dead35449 external/mit/lua/dist/Makefile
--- a/external/mit/lua/dist/Makefile Mon Jan 02 20:57:28 2023 +0000
+++ b/external/mit/lua/dist/Makefile Fri Jun 02 14:13:25 2023 +0000
@@ -36,7 +36,7 @@ RM= rm -f
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
# Convenience platforms targets.
-PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
+PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
# What to install.
TO_BIN= lua luac
@@ -46,7 +46,7 @@ TO_MAN= lua.1 luac.1
# Lua version and release.
V= 5.4
-R= $V.4
+R= $V.6
# Targets start here.
all: $(PLAT)
diff -r 8fdce1000ba3 -r 1b5dead35449 external/mit/lua/dist/README
--- a/external/mit/lua/dist/README Mon Jan 02 20:57:28 2023 +0000
+++ b/external/mit/lua/dist/README Fri Jun 02 14:13:25 2023 +0000
@@ -1,5 +1,5 @@
-This is Lua 5.4.4, released on 13 Jan 2022.
+This is Lua 5.4.6, released on 02 May 2023.
For installation instructions, license details, and
further information about Lua, see doc/readme.html.
diff -r 8fdce1000ba3 -r 1b5dead35449 external/mit/lua/dist/doc/contents.html
--- a/external/mit/lua/dist/doc/contents.html Mon Jan 02 20:57:28 2023 +0000
+++ b/external/mit/lua/dist/doc/contents.html Fri Jun 02 14:13:25 2023 +0000
@@ -32,7 +32,7 @@ For a complete introduction to Lua progr
<P>
<SMALL>
-Copyright © 2020–2022 Lua.org, PUC-Rio.
+Copyright © 2020–2023 Lua.org, PUC-Rio.
Freely available under the terms of the
<A HREF="http://www.lua.org/license.html">Lua license</A>.
</SMALL>
@@ -85,6 +85,8 @@ Freely available under the terms of the
<LI><A HREF="manual.html#3.4.9">3.4.9 – Table Constructors</A>
<LI><A HREF="manual.html#3.4.10">3.4.10 – Function Calls</A>
<LI><A HREF="manual.html#3.4.11">3.4.11 – Function Definitions</A>
+<LI><A HREF="manual.html#3.4.12">3.4.12 – Lists of expressions, multiple results, and adjustment<A>
+
</UL>
<LI><A HREF="manual.html#3.5">3.5 – Visibility Rules</A>
</UL>
@@ -613,7 +615,7 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-LUA_HOOKLINE">LUA_HOOKLINE</A><BR>
<A HREF="manual.html#pdf-LUA_HOOKRET">LUA_HOOKRET</A><BR>
<A HREF="manual.html#pdf-LUA_HOOKTAILCALL">LUA_HOOKTAILCALL</A><BR>
-<A HREF="manual.html#pdf-LUAL_BUFFERSIZE">LUAL_BUFFERSIZE</A><BR>
+<A HREF="manual.html#pdf-LUA_LOADED_TABLE">LUA_LOADED_TABLE</A><BR>
<A HREF="manual.html#pdf-LUA_MASKCALL">LUA_MASKCALL</A><BR>
<A HREF="manual.html#pdf-LUA_MASKCOUNT">LUA_MASKCOUNT</A><BR>
<A HREF="manual.html#pdf-LUA_MASKLINE">LUA_MASKLINE</A><BR>
@@ -641,6 +643,7 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-LUA_OPSHR">LUA_OPSHR</A><BR>
<A HREF="manual.html#pdf-LUA_OPSUB">LUA_OPSUB</A><BR>
<A HREF="manual.html#pdf-LUA_OPUNM">LUA_OPUNM</A><BR>
+<A HREF="manual.html#pdf-LUA_PRELOAD_TABLE">LUA_PRELOAD_TABLE</A><BR>
<A HREF="manual.html#pdf-LUA_REFNIL">LUA_REFNIL</A><BR>
<A HREF="manual.html#pdf-LUA_REGISTRYINDEX">LUA_REGISTRYINDEX</A><BR>
<A HREF="manual.html#pdf-LUA_RIDX_GLOBALS">LUA_RIDX_GLOBALS</A><BR>
@@ -657,6 +660,7 @@ Freely available under the terms of the
<A HREF="manual.html#pdf-LUA_TUSERDATA">LUA_TUSERDATA</A><BR>
<A HREF="manual.html#pdf-LUA_USE_APICHECK">LUA_USE_APICHECK</A><BR>
<A HREF="manual.html#pdf-LUA_YIELD">LUA_YIELD</A><BR>
+<A HREF="manual.html#pdf-LUAL_BUFFERSIZE">LUAL_BUFFERSIZE</A><BR>
</TD>
</TR>
@@ -664,10 +668,10 @@ Freely available under the terms of the
<P CLASS="footer">
Last update:
-Thu Jan 13 11:32:22 UTC 2022
+Sat Apr 1 17:57:05 UTC 2023
</P>
<!--
-Last change: revised for Lua 5.4.4
+Last change: revised for Lua 5.4.5
-->
</BODY>
diff -r 8fdce1000ba3 -r 1b5dead35449 external/mit/lua/dist/doc/lua.1
--- a/external/mit/lua/dist/doc/lua.1 Mon Jan 02 20:57:28 2023 +0000
+++ b/external/mit/lua/dist/doc/lua.1 Fri Jun 02 14:13:25 2023 +0000
@@ -1,7 +1,7 @@
-.\" $NetBSD: lua.1,v 1.1.1.10 2023/01/02 20:57:29 nikita Exp $
+.\" $NetBSD: lua.1,v 1.1.1.11 2023/06/02 14:13:25 nikita Exp $
.\"
-.\" Id: lua.man,v 1.14 2020/05/21 19:31:21 lhf Exp
-.TH LUA 1 "Date: 2020/05/21 19:31:21 "
+.\" Id: lua.man,v 1.14 2022/09/23 09:06:36 lhf Exp
+.TH LUA 1 "Date: 2022/09/23 09:06:36 "
.SH NAME
lua \- Lua interpreter
.SH SYNOPSIS
@@ -88,11 +88,17 @@ execute statement
enter interactive mode after executing
.IR script .
.TP
-.BI \-l " name"
+.BI \-l " mod"
require library
-.I name
+.I mod
into global
-.IR name .
+.IR mod .
+.TP
+.BI \-l " g=mod"
+require library
+.I mod
+into global
+.IR g .
.TP
.B \-v
show version information.
diff -r 8fdce1000ba3 -r 1b5dead35449 external/mit/lua/dist/doc/manual.html
--- a/external/mit/lua/dist/doc/manual.html Mon Jan 02 20:57:28 2023 +0000
+++ b/external/mit/lua/dist/doc/manual.html Fri Jun 02 14:13:25 2023 +0000
@@ -19,7 +19,7 @@ by Roberto Ierusalimschy, Luiz Henrique
<P>
<SMALL>
-Copyright © 2020–2022 Lua.org, PUC-Rio.
+Copyright © 2020–2023 Lua.org, PUC-Rio.
Freely available under the terms of the
<a href="http://www.lua.org/license.html">Lua license</a>.
</SMALL>
@@ -63,7 +63,7 @@ and rapid prototyping.
<p>
Lua is implemented as a library, written in <em>clean C</em>,
-the common subset of Standard C and C++.
+the common subset of standard C and C++.
The Lua distribution includes a host program called <code>lua</code>,
which uses the Lua library to offer a complete,
standalone Lua interpreter,
@@ -1379,7 +1379,9 @@ Lua also accepts hexadecimal constants,
which start with <code>0x</code> or <code>0X</code>.
Hexadecimal constants also accept an optional fractional part
plus an optional binary exponent,
-marked by a letter '<code>p</code>' or '<code>P</code>'.
+marked by a letter '<code>p</code>' or '<code>P</code>' and written in decimal.
+(For instance, <code>0x1.fp10</code> denotes 1984,
+which is <em>0x1f / 16</em> multiplied by <em>2<sup>10</sup></em>.)
<p>
@@ -1621,21 +1623,13 @@ Expressions are discussed in <a href="#3
<p>
Before the assignment,
the list of values is <em>adjusted</em> to the length of
-the list of variables.
-If there are more values than needed,
-the excess values are thrown away.
-If there are fewer values than needed,
-the list is extended with <b>nil</b>'s.
-If the list of expressions ends with a function call,
-then all values returned by that call enter the list of values,
-before the adjustment
-(except when the call is enclosed in parentheses; see <a href="#3.4">§3.4</a>).
+the list of variables (see <a href="#3.4.12">§3.4.12</a>).
<p>
If a variable is both assigned and read
inside a multiple assignment,
-Lua ensures all reads get the value of the variable
+Lua ensures that all reads get the value of the variable
before the assignment.
Thus the code
@@ -1739,11 +1733,6 @@ even if this other label has been declar
<p>
-Labels and empty statements are called <em>void statements</em>,
-as they perform no actions.
-
-
-<p>
The <b>break</b> statement terminates the execution of a
<b>while</b>, <b>repeat</b>, or <b>for</b> loop,
skipping to the next statement after the loop:
@@ -2059,7 +2048,7 @@ function calls are explained in <a href=
table constructors are explained in <a href="#3.4.9">§3.4.9</a>.
Vararg expressions,
denoted by three dots ('<code>...</code>'), can only be used when
-directly inside a vararg function;
+directly inside a variadic function;
they are explained in <a href="#3.4.11">§3.4.11</a>.
@@ -2074,52 +2063,6 @@ the unary logical <b>not</b> (see <a hre
and the unary <em>length operator</em> (see <a href="#3.4.7">§3.4.7</a>).
-<p>
-Both function calls and vararg expressions can result in multiple values.
-If a function call is used as a statement (see <a href="#3.3.6">§3.3.6</a>),
-then its return list is adjusted to zero elements,
-thus discarding all returned values.
-If an expression is used as the last (or the only) element
-of a list of expressions,
-then no adjustment is made
-(unless the expression is enclosed in parentheses).
-In all other contexts,
-Lua adjusts the result list to one element,
-either discarding all values except the first one
-or adding a single <b>nil</b> if there are no values.
-
-
-<p>
-Here are some examples:
-
-<pre>
- f() -- adjusted to 0 results
- g(f(), x) -- f() is adjusted to 1 result
- g(x, f()) -- g gets x plus all results from f()
- a,b,c = f(), x -- f() is adjusted to 1 result (c gets nil)
- a,b = ... -- a gets the first vararg argument, b gets
- -- the second (both a and b can get nil if there
- -- is no corresponding vararg argument)
-
- a,b,c = x, f() -- f() is adjusted to 2 results
- a,b,c = f() -- f() is adjusted to 3 results
- return f() -- returns all results from f()
- return ... -- returns all received vararg arguments
- return x,y,f() -- returns x, y, and all results from f()
- {f()} -- creates a list with all results from f()
- {...} -- creates a list with all vararg arguments
- {f(), nil} -- f() is adjusted to 1 result
-</pre>
-
-<p>
-Any expression enclosed in parentheses always results in only one value.
-Thus,
-<code>(f(x,y,z))</code> is always a single value,
-even if <code>f</code> returns several values.
-(The value of <code>(f(x,y,z))</code> is the first value returned by <code>f</code>
-or <b>nil</b> if <code>f</code> does not return any values.)
-
-
@@ -2252,8 +2195,9 @@ Note that bitwise operators do not do th
<p>
-Nonetheless, it is always a good practice not to rely on these
-implicit coercions, as they are not always applied;
+It is always a good practice not to rely on the
+implicit coercions from strings to numbers,
+as they are not always applied;
in particular, <code>"1"==1</code> is false and <code>"1"<1</code> raises an error
(see <a href="#3.4.4">§3.4.4</a>).
These coercions exist mainly for compatibility and may be removed
@@ -2558,9 +2502,9 @@ The order of the assignments in a constr
<p>
If the last field in the list has the form <code>exp</code>
-and the expression is a function call or a vararg expression,
+and the expression is a multires expression,
then all values returned by this expression enter the list consecutively
-(see <a href="#3.4.10">§3.4.10</a>).
+(see <a href="#3.4.12">§3.4.12</a>).
<p>
@@ -2624,7 +2568,7 @@ A call of the form <code>return <em>func
scope of a to-be-closed variable is called a <em>tail call</em>.
Lua implements <em>proper tail calls</em>
(or <em>proper tail recursion</em>):
-in a tail call,
+In a tail call,
the called function reuses the stack entry of the calling function.
Therefore, there is no limit on the number of nested tail calls that
a program can execute.
@@ -2727,22 +2671,16 @@ initialized with the argument values:
</pre><p>
When a Lua function is called,
it adjusts its list of arguments to
-the length of its list of parameters,
-unless the function is a <em>vararg function</em>,
+the length of its list of parameters (see <a href="#3.4.12">§3.4.12</a>),
+unless the function is a <em>variadic function</em>,
which is indicated by three dots ('<code>...</code>')
at the end of its parameter list.
-A vararg function does not adjust its argument list;
+A variadic function does not adjust its argument list;
Home |
Main Index |
Thread Index |
Old Index