197 Commits
Author SHA1 Message Date
Roberto I 15b2a78106 Bug: Calling coroutine.close while closing after error
A call to 'coroutine.close()' while closing the coroutine returns like
'resume', with no errors, even if the coroutine previously had stopped
due to an error.
2026-10-15 13:53:40 -03:00
Roberto I 6db80b55c1 Small corrections/improvements in the manual 2026-10-12 16:25:19 -03:00
Roberto I 973777c74e Details 2026-09-16 11:49:35 -03:00
Roberto I d5bbe95584 Details
- Some api_checknelems changed to the more restrict api_checkpop.
- Added a class to the html for APIs in the manual.
- Comments and manual.
2026-07-22 13:43:40 -03:00
Roberto I 84938a7d2b MacOS by default uses statically linked readline
(plus detail in the manual)
2026-07-15 15:39:07 -03:00
Roberto I 6ca33260d2 Removed compiler option LUA_COMPAT_LOOPVAR
It makes loop variables read-only, but it does not restore the old
semantics, so it is not helpful for compatibility.
2026-07-13 15:18:37 -03:00
Roberto Ierusalimschy 0da6d320f7 Details 2026-04-28 13:44:29 -03:00
Roberto I 0c16a42d61 Details
Added compiler option LUA_NODEBUGLIB to make Lua with no open debug
library + small improvements in the manual.
2026-04-21 15:27:22 -03:00
Roberto I 9e501d9855 Slightly better documentation for LUAI_MAXALIGN 2026-03-09 16:23:03 -03:00
Roberto Ierusalimschy 7c40c5edb2 Details
Spaces + added initialization to the documentation of global
declarations.
2026-02-10 16:41:02 -03:00
Roberto I efbc297545 New year and (eventual) new release 2026-01-29 14:24:25 -03:00
Roberto I cfcaa9493b Explanation about char* parameters in the C API 2026-01-23 16:25:18 -03:00
Roberto Ierusalimschy e992c6a959 Some compilation options configurable from makefile
Compilation options LUA_COMPAT_GLOBAL, LUA_COMPAT_LOOPVAR, and
LUA_READLINELIB do not affect the API, so they can be changed
through the make file.
2026-01-20 13:06:16 -03:00
Roberto I 82d721a855 Format adjust in the manual
Lists in inline code don't get a space after commas. (That keeps the
code more compact and avoids line breaks in the middle of the code.)
2025-12-10 10:35:05 -03:00
Roberto I 104b0fc700 Details
- Avoid fixing name "_ENV" in the code
- Small improvements in the manual
2025-12-08 13:09:47 -03:00
Roberto I a07f6a8241 Functions with vararg tables don't need hidden args.
Vararg functions with vararg tables don't use the arguments hidden in
the stack; therfore, it doesn't need to build/keep them.
2025-11-28 15:12:51 -03:00
Roberto I f33cc4ddec New conceptual model for vararg
Conceptually, all functions get their vararg arguments in a vararg
table. The storing of vararg arguments in the stack is always treated
as an optimization.
2025-11-26 11:18:29 -03:00
Roberto I d94f7ba304 Details
Comments, capitalization in the manual, globals in test 'heady.lua'
2025-11-24 11:39:46 -03:00
Roberto I 4cf498210e '__pairs' can also return a to-be-closed object 2025-11-11 15:11:06 -03:00
Roberto I e44f3a2ffc Global initialization checks name conflict
Initialization "global a = 10" raises an error if global 'a' is already
defined, that is, it has a non-nil value.
2025-11-08 11:43:42 -03:00
Roberto I d342328e5b Vertical bar removed from syntax of vararg table
The syntax 'function foo (a, b, ...arg)' is already used by JavaScript
for this same semantics, so it seems natural to use the same notation in
Lua.
2025-10-30 11:07:01 -03:00
Roberto I b352217b84 Standard allocator function added to the API
That makes easier to redefine luaL_newstate.
2025-10-17 13:53:35 -03:00
Roberto I 25c54fe60e Optimization for vararg tables
A vararg table can be virtual. If the vararg table is used only as
a base in indexing expressions, the code does not need to create an
actual table for it. Instead, it compiles the indexing expressions
into direct accesses to the internal vararg data.
2025-09-24 18:33:08 -03:00
Roberto I c345877e4c Better documentation for LUA_ERRERR
Not all errors in a message handler generate a LUA_ERRERR.
2025-08-20 15:29:46 -03:00
Roberto I 53dc5a3bba Functions 'frexp'-'ldexp' back to the math library
They are basic for anything that handles the representation of
floating numbers.
2025-08-09 15:15:20 -03:00
Roberto I 5b179eaf6a Details 2025-08-09 15:08:53 -03:00
Roberto Ierusalimschy 60b6599e83 Short strings can be external, too
That complicates a little object equality (and therefore table access
for long strings), but the old behavior was somewhat weird. (Short
strings, a concept otherwise absent from the manual, could not be
external.)
2025-07-15 14:40:27 -03:00
Roberto Ierusalimschy 942c10a5e3 Optional initialization for global declarations 2025-07-08 13:33:57 -03:00
Roberto Ierusalimschy 1da89da62f Manual updated to version 5.5 2025-06-27 14:46:41 -03:00
Roberto Ierusalimschy f711567448 Check string indices when loading binary chunk
Lua is not religious about that, but it tries to avoid crashes when
loading binary chunks.
2025-06-17 11:40:49 -03:00
Roberto Ierusalimschy e657a48ea5 The main thread cannot be closed
No thread started with pcall (instead of resume) can be closed,
because coroutine.close would not respect the expected number of
results from the protected call.
2025-06-13 14:08:38 -03:00
Roberto Ierusalimschy fd897027f1 A coroutine can close itself
A call to close itself will close all its to-be-closed variables and
return to the resume that (re)started the coroutine.
2025-06-12 11:15:09 -03:00
Roberto Ierusalimschy d05fe48bfd Loading a binary chunk should not break assertions
Although the execution of a bad binary chunk can crash the interpreter,
simply loading it should be safe.
2025-06-04 12:55:43 -03:00
Roberto Ierusalimschy 6d53701c7a Proper error message when jumping into 'global *'
A goto cannot jump into the scope of any variable declaration,
including 'global *'. To report the error, it needs a "name" for
the scope it is entering.
2025-05-18 12:03:54 -03:00
Roberto Ierusalimschy abbae57c78 Variable attributes can prefix name list
In this format, the attribute applies to all names in the list;
e.g. "global<const> print, require, math".
2025-05-18 11:43:43 -03:00
Roberto Ierusalimschy 3b9dd52be0 Collective declaration for globals ('global *') 2025-05-13 11:43:10 -03:00
Roberto Ierusalimschy 3f0ea90aa8 New syntax 'global function' 2025-05-08 11:08:03 -03:00
Roberto Ierusalimschy be81209063 First implementation of global declarations 2025-05-05 16:24:59 -03:00
Roberto Ierusalimschy 3f4f28010a io.write returns number of written bytes on error 2025-04-03 11:32:49 -03:00
Roberto Ierusalimschy fdbb4c2341 Detail in the manual 2025-03-17 16:05:47 -03:00
Roberto Ierusalimschy d9e0f64a5d Small changes in the manual 2025-03-12 15:45:39 -03:00
Roberto Ierusalimschy ee99452158 Error object cannot be nil
Lua will change a nil as error object to a string message, so that it
never reports an error with nil as the error object.
2025-02-28 14:53:58 -03:00
Roberto Ierusalimschy 127a8e80fe '__close' gets no error object if there is no error
Instead of receiving nil as a second argument, __close metamethods are
called with just one argument when there are no errors.
2025-02-28 10:10:27 -03:00
Roberto Ierusalimschy ceac82f78b Details
Comments, small changes in the manual, an extra test for errors in
error handling, small changes in tests.
2025-02-26 11:29:54 -03:00
Roberto Ierusalimschy c4e7cdb541 Renaming two new functions
'lua_numbertostrbuff' -> 'lua_numbertocstring'
'lua_pushextlstring' -> 'lua_pushexternalstring'
2025-01-27 16:09:55 -03:00
Roberto Ierusalimschy 7d7ae8781e Parameters for 'lua_createtable' back to int
Tables don't accept sizes larger than int.
2025-01-21 13:33:59 -03:00
Roberto Ierusalimschy 2d8d5c74b5 Details
New year (2024->2025), typos in comments
2025-01-16 11:51:16 -03:00
Roberto Ierusalimschy 3cdd49c94a Fixed conversion warnings from clang
Plus some other details. (Option '-Wuninitialized' was removed from
the makefile because it is already enabled by -Wall.)
2025-01-14 16:24:46 -03:00
Roberto Ierusalimschy 915c29f8bd Improvements in the manual
Plus details
2025-01-10 15:11:54 -03:00
Roberto Ierusalimschy 50c7c915ee Debug information about extra arguments from __call
'debug.getinfo' can return number of extra arguments added to a call by
a chain of __call metavalues. That information is being used to improve
error messages about errors in these extra arguments.
2024-11-19 14:09:18 -03:00