aboutsummaryrefslogtreecommitdiff
path: root/testes (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-10-22Removed extra information from RCS keyword strings in testsRoberto Ierusalimschy6-4/+4
Version numbers and dates (mostly wrong) from RCS keyword strings removed from all test files; only the file name are kept.
2018-10-22Small improvements in the manualRoberto Ierusalimschy1-8/+18
2018-10-22Complete implementation of to-be-closed variablesRoberto Ierusalimschy3-12/+39
2018-10-18Handling of memory errors when creating to-be-closed upvaluesRoberto Ierusalimschy4-40/+148
2018-10-17First "complete" implementation of to-be-closed variablesRoberto Ierusalimschy13-26/+145
Still missing: - handling of memory errors when creating upvalue (must run closing method all the same) - interaction with coroutines
2018-10-08Towards "to closed" local variablesRoberto Ierusalimschy15-22/+81
Start of the implementation of "scoped variables" or "to be closed" variables, local variables whose '__close' (or themselves) are called when they go out of scope. This commit implements the syntax, the opcode, and the creation of the corresponding upvalue, but it still does not call the finalizations when the variable goes out of scope (the most important part). Currently, the syntax is 'local scoped name = exp', but that will probably change.
2018-09-11Added "cost" for the use of C stack by a coroutine invocation.Roberto Ierusalimschy1-2/+8
Resuming a coroutine uses more C stack than other operations (such as function calls or recursive syntax). So, to avoid stack overflow in recursive coroutine invocations, either LUAI_MAXCCALLS must be too small or a coroutine invocation must "pay" a higher price. New constant LUAL_COROCSTK ("COROutine C STaK") defines how much is this price.
2018-09-11Details (comments)Roberto Ierusalimschy3-4/+11
2018-08-28Corrections in the implementation of '%' for floats.Roberto Ierusalimschy5-18/+87
The multiplication (m*b) used to test whether 'm' is non-zero and 'm' and 'b' have different signs can underflow for very small numbers, giving a wrong result. The use of explicit comparisons solves this problem. This commit also adds several new tests for '%' (both for floats and for integers) to exercise more corner cases, such as very large and very small values.
2018-08-24Deprecated the emulation of '__le' using '__lt'Roberto Ierusalimschy8-40/+44
As hinted in the manual for Lua 5.3, the emulation of the metamethod for '__le' using '__le' has been deprecated. It is slow, complicates the logic, and it is easy to avoid this emulation by defining a proper '__le' function. Moreover, often this emulation was used wrongly, with a programmer assuming that an order is total when it is not (e.g., NaN in floating-point numbers).
2018-08-23Removed extra information from RCS keyword stringsRoberto Ierusalimschy51-51/+51
Version numbers and dates (mostly wrong) from RCS keyword strings removed from all source files; only the file name are kept.
2018-08-17detailsRoberto Ierusalimschy1-6/+6
Minor optimizations in 'lvm.c'. (Not exactly optimizations, but more chances for optimizations.)
2018-08-16Removed use of 'rl_inhibit_completion' in 'lua.c'Roberto Ierusalimschy1-3/+2
Some old systems (e.g., Mac OS X 10.4) do not define 'rl_inhibit_completion', even when line history is available. Anyway, the user can configure this option externally, using '~/.inputrc'.
2018-07-27Added "emergency collection" to 'io.tmpfile' and 'os.tmpname'Roberto Ierusalimschy5-50/+71
These operations also can give errors for lack of resources, so they also will try "emergency collections" in case of resource errors. Because there are now two libraries with that kind of handling, 'resourcetryagain' was moved to the auxiliary library to be shared by the libraries.
2018-07-25Added directory to test file names in '$Id:'Roberto Ierusalimschy29-29/+29
From the point of view of 'git', all names are relative to the root directory of the project. So, file names in '$Id:' also should be relative to that directory: the proper name for test file 'all.lua' is 'testes/all.lua'.
2018-07-25Small improvements in the manualRoberto Ierusalimschy1-5/+7
2018-07-25File operations try an "emergency collection" when failingRoberto Ierusalimschy2-6/+65
If a file operation fails do to lack of resources (too many open files or not enough memory), it does a full garbage collection and tries the operation again. Lack of resources are "too many open files" (process wise and system wise) and "not enough memory". The code is full of '#if's because error codes are not part of the standard ISO C.
2018-07-18Comments about OLD0/OLD1 agesRoberto Ierusalimschy1-24/+30
Improved the comments in file 'lgc.c' explaining the roles of "ages" OLD0 and OLD1 in the generacional collector.
2018-07-13Fixed bug in generational collection of userdataRoberto Ierusalimschy4-15/+102
During generational collection, a userdatum must become gray and go to a gray list after being traversed (like tables), so that 'correctgraylist' can handle it to its next stage. This commit also added minimum tests for the generational collector, including one that would detect this bug.
2018-07-12Avoid using 'int' for UTF-8 valuesRoberto Ierusalimschy1-11/+22
An 'int' may have only 16 bits, so it may not be big enough for UTF-8 values. The new type 'utfint' (in the utf8 library) ensures at least 21 bits for those values.
2018-07-11Bug: wrong 'nCcalls' when resuming a coroutineRoberto Ierusalimschy2-5/+24
The counter 'nCcalls' now includes the number of CallInfo structures pre-allocated (so that these "potential" C calls can be made without checking 'nCcalls'). So, when copying this value from a thread to another, in 'lua_resume', it must be corrected to the number of CallInfo structures in the thread being resumed.
2018-07-11Added definition for LUA_VERSION_RELEASE_NUMRoberto Ierusalimschy1-1/+3
LUA_VERSION_RELEASE_NUM is set to the release number of the Lua interpreter (e.g., 5.4.0 becomes the integer 50400).
2018-07-11Fixed bug in line info. when using 'not' operatorRoberto Ierusalimschy3-26/+93
When creating code for a jump on a 'not' condition, the code generator was removing an instruction (the OP_NOT) without adjusting its corresponding line information. This fix also added tests for this case and extra functionality in the test library to debug line info. structures.
2018-07-10In tests of opcodes, avoid coercion in bitwise operationRoberto Ierusalimschy1-1/+1
2018-07-10Improvements in the manualRoberto Ierusalimschy1-14/+17
- More precise use of 'argument' x 'parameter'. - Clarification about what the lexer considers 'letter', 'space', and 'digit'.
2018-07-10Added missing $Id$ to file 'ljumptab.h'Roberto Ierusalimschy1-0/+7
2018-07-09Generational mode may wait longer after a major collectionRoberto Ierusalimschy1-8/+25
When Lua is building large long-duration structures, frequent small minor collections just waste time. Trying to avoid this, the collector will do a larger pause after a major collection when it does not collect enough garbage (which is a hint that memory is being used for long-lasting objects).
2018-07-09'searchpath' creates less temporary stringsRoberto Ierusalimschy1-18/+34
When creating error messages, package loaders may create dozens of temporary strings (one or more for each tried template). This change reduces the number of these strings, and avoid creating some of them if the search is successful.
2018-07-09Bit-library file removed from the project (as it was deprecated)Roberto Ierusalimschy1-7/+0
This commit only removed the file 'lbitlib.c' from the project; the makefile already was not using it.
2018-07-09Opcode names moved to a new header fileRoberto Ierusalimschy4-94/+100
The array with the names of the opcodes was moved to a header file ('lopnames.h'), as it is not used by the Lua kernel. Files that need that array ('luac.c' and 'ltests.c') include the header file to get a private (static) copy.
2018-07-09Fixed bug in OP_IDIVIRoberto Ierusalimschy2-3/+14
Opocode was using 'luai_numdiv' (float division) instead of 'luai_numidiv' (integer division).
2018-07-09Added manual and tests for version 5.4-w2Roberto Ierusalimschy37-0/+22260
2018-06-19opening functions must be exported!v5.4-w2Roberto Ierusalimschy1-5/+3
2018-06-18several detailsRoberto Ierusalimschy1-11/+10
2018-06-18in generational mode, an emergency collection can turn any object blackRoberto Ierusalimschy1-3/+3
during any memory allocation + 'luaT_getvarargs' may reallocate the stack, and therefore the top must be correct.
2018-06-18in generational mode, an emergency collection can turn any object blackRoberto Ierusalimschy1-2/+2
during any memory allocation.
2018-06-18change in 'LUAI_DDEC' to allow variables to be static in 'onelua'Roberto Ierusalimschy4-13/+17
+ change in 'LUAMOD_API' as opening functions do not need to be global
2018-06-18no need to check whether libraries and host use the same kernel;Roberto Ierusalimschy6-23/+18
Lua should work correctly with several copies of the kernel
2018-06-15new field 'nilvalue' in struct 'global_State' to avoid the use ofRoberto Ierusalimschy5-22/+17
addresses of static variables
2018-06-15removed unused macros 'isstackindex'/'api_checkstackindex' +Roberto Ierusalimschy1-10/+2
macro 'api_checkvalidindex' (used only once) expanded and removed
2018-06-15detail (removed unused definition for 'LUA_QS')Roberto Ierusalimschy1-10/+2
2018-06-15warning (comparison between signed and unsigned integers)Roberto Ierusalimschy1-2/+3
2018-06-15field 'sizearray' in struct 'Table' changed to 'alimit', which canRoberto Ierusalimschy7-54/+201
be used as a hint for '#t'
2018-06-15new macro 'ispow2'Roberto Ierusalimschy1-1/+7
2018-06-14type 'Rand64' may not be long long, so it should not use 'LL' in itsRoberto Ierusalimschy1-4/+5
constants
2018-06-11no more 'TESTGRAYBIT' (to free this bit for real uses)Roberto Ierusalimschy2-24/+8
2018-06-08detail in commentRoberto Ierusalimschy1-2/+2
2018-06-08added 'const' to 'Proto*' when possibleRoberto Ierusalimschy4-23/+24
2018-06-08added patch for bug 5.3.4-7Roberto Ierusalimschy1-2/+40
2018-06-01no more 'luaO_nilobject' to avoid comparison of global variable addressesRoberto Ierusalimschy5-20/+12
(now uses static variables)