- Jun 06, 2019
-
-
Roberto Ierusalimschy authored
-
- Jun 05, 2019
-
-
Roberto Ierusalimschy authored
-
Roberto Ierusalimschy authored
When there are multiple errors when closing objects, the error reported by the protected call is the first one, for two reasons: First, other errors may be caused by this one; second, the first error is handled in the original execution context, and therefore has the full traceback.
-
- Jun 04, 2019
-
-
Roberto Ierusalimschy authored
Instead of a 'tocont' flag, the function 'warn' in Lua now receives all message pieces as multiple arguments in a single call. Besides being simpler to use, this implementation ensures that Lua code cannot create unfinished warnings.
-
- Jun 03, 2019
-
-
Roberto Ierusalimschy authored
-
Roberto Ierusalimschy authored
Closing methods must be run before correcting 'ci->func' when exiting a vararg function, to get correct debug information (e.g., in case of errors).
-
Roberto Ierusalimschy authored
Several small changes from feedback on 5.4 alhpa rc1 (warnings, typos in the manual, and the like)
-
Roberto Ierusalimschy authored
- tests show progress in real time, so that we can see maximum stack levels even if test crashes. - new test for recursion continuing into message handler.
-
- May 28, 2019
-
-
Roberto Ierusalimschy authored
'luaL_traceback' changed to use an aux buffer instead of concats. This should reduce the quantity of garbage it generates (in the form of intermediate strings) while producing a trackback. It also added information about the number of levels skipped when skipping levels in a trace.
-
Roberto Ierusalimschy authored
- new error message for "attempt to assign to const variable" - note in the manual about compatibility options - comments - small changes in 'read_line' and 'pushstr'
-
- May 17, 2019
-
-
Roberto Ierusalimschy authored
A variable can be declared const, which means it cannot be assigned to, with the syntax 'local <const> name = exp'.
-
- May 14, 2019
-
-
Roberto Ierusalimschy authored
The previous definition of LUA_MAXUNSIGNED used a typecast, making it unsuitable for constant expressions in the preprocessor.
-
- May 13, 2019
-
-
Roberto Ierusalimschy authored
- 'luaL_setfuncs' avoids creating closures for placeholders. - Fixed some warnings about unused values in comma expressions. - Comments.
-
Roberto Ierusalimschy authored
- The preprocessor must work with at least 'long', and therefore must do shifts of up to 31 bits correctly. - Whenever possible, use unsigned types in shifts.
-
Roberto Ierusalimschy authored
Added '#if !defined' in some definitions to allow external definitions; more comments; other small changes.
-
- May 09, 2019
-
-
Roberto Ierusalimschy authored
The flag for to-be-closed variables was changed from '*toclose' to '<toclose>'. Several people found confusing the old syntax and the new one has a clear terminator, making it more flexible for future changes.
-
Roberto Ierusalimschy authored
The test for dead coroutines done in the 'coro' library was moved to 'lua_resume', in the kernel, which already does other similar tests.
-
Roberto Ierusalimschy authored
Back to how it was, a coroutine does not unwind its stack in case of errors (and therefore do not close its to-be-closed variables). This allows the stack to be examined after the error. The program can use 'coroutine.kill' to close the variables. The function created by 'coroutine.wrap', however, closes the coroutine's variables in case of errors, as it is impossible to examine the stack any way.
-
- May 03, 2019
-
-
Roberto Ierusalimschy authored
Instead of being a copy of 'lib2.so', 'lib2-v2.so' has its own source file ('lib22.c'), so that the test can distinguish both libraries.
-
Roberto Ierusalimschy authored
- 'L' added to the 'BuffFS' structure - '%c' does not handle control characters (it is not its business. This now is done by the lexer, who is the one in charge of that kind of errors.) - avoid the direct use of 'l_sprintf' in the Lua kernel
-
Roberto Ierusalimschy authored
Both when setting a path and searching for a file ('searchpath'), this commit reduces the number of intermediate strings created in Lua. (For setting a path the change is not relevant, because this is done only twice when loading the module. Anyway, it is a nice example of how to use auxlib buffers to manipulate strings in the C API.)
-
- Apr 26, 2019
-
-
Roberto Ierusalimschy authored
Details: - counter 'pushed' moved to the struct 'BuffFS' - new auxiliar function 'getbuff' to build strings directly on the buffer.
-
Roberto Ierusalimschy authored
To-be-closed variables in C use 'ci.nresults' to code that there is a variable to be closed in that function. The intialization of the base C level (the one "running" when calling API functions outside any Lua call) did not initialize 'ci.nresults', creating (correct) warnings in valgrind.
-
- Apr 24, 2019
-
-
Roberto Ierusalimschy authored
Added a new function 'luaL_addgsub', similar to 'luaL_gsub' but that adds its result directly to a preexisting buffer, avoiding the creation of one extra intermediate string. Also added two simple macros, 'luaL_bufflen' and 'luaL_buffaddr', to query the current length and the contents address of a buffer.
-
Roberto Ierusalimschy authored
The function 'luaO_pushvfstring' now uses an internal buffer to concatenate small strings, instead of pushing all pieces on the stack. This avoids the creation of several small Lua strings for each piece of the result. (For instance, a format like "n: '%d'" used to create three intermediate strings: "n: '", the numeral, and "'". Now it creates none.)
-
- Apr 22, 2019
-
-
Roberto Ierusalimschy authored
The field 'isdst' can be false, so we cannot test its absence with 'if not D.isdst'; we must compare with nil for a correct test.
-
- Apr 17, 2019
-
-
Roberto Ierusalimschy authored
The function 'require' returns the *loader data* as a second result. For file searchers, this data is the path where they found the module.
-
- Apr 12, 2019
-
-
Roberto Ierusalimschy authored
The result of "string.format("%.99f", -1e308) is 410 characters long, but all other formats have much smaller limits (at most 99 plus a fex extras). This commit avoids 'string.format' asking for a buffer ~400 chars large when ~100 will do.
-
- Apr 11, 2019
-
-
Roberto Ierusalimschy authored
Avoid creating extra strings when possible: - avoid creating new resulting string when subject was not modified (instead, return the subject itself); - avoid creating strings representing the captured substrings when handling replacements like '%1' (instead, add the substring directly to the buffer).
-
- Apr 10, 2019
-
-
Roberto Ierusalimschy authored
-
Roberto Ierusalimschy authored
-
Roberto Ierusalimschy authored
-
- Apr 09, 2019
-
-
Roberto Ierusalimschy authored
The field 'isdst' in date tables may not be present; portable tests should not assume it is.
-
Roberto Ierusalimschy authored
Code like 'a = 1print()' should not be accepted.
-
- Apr 04, 2019
-
-
Roberto Ierusalimschy authored
Bug introduced in commit 28d829c8: OP_TAILCALL might raise an error without saving 'pc'. (This commit also fixes a detail in 'testes/uf8.lua'.)
-
Roberto Ierusalimschy authored
This new field gets the length of 'source' in the same structure. Unlike the other strings in that structure, 'source' can be relatively large, and Lua already has its length readily available.
-
- Apr 01, 2019
-
-
Roberto Ierusalimschy authored
The 'GCSenteratomic' is just an auxiliary state for transitioning to 'GCSatomic'. All GC traversals should be done either on the 'GCSpropagate' state or the 'GCSatomic' state.
-
- Mar 27, 2019
-
-
Roberto Ierusalimschy authored
Checks of the form '1 <= x && x <= M' were rewritten in the form '(unsigned)x - 1 < (unsigned)M', which is usually more efficient. (Other similar checks have similar translations.) Although some compilers do these optimizations, that does not happen for all compilers or all cases.
-
- Mar 25, 2019
-
-
Roberto Ierusalimschy authored
The limit LUAI_MAXCCALLS was renamed LUAI_MAXCSTACK, which better represents its meaning. Moreover, its definition was moved to 'luaconf.h', given its importance now that Lua does not use a "stackless" implementation.
-
Roberto Ierusalimschy authored
-