Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Detailsv5.4.5 | Roberto Ierusalimschy | 2023-04-18 | 1 | -1/+1 |
| | | | | Typos in comments and details in the manual. | ||||
* | Documentation | Roberto Ierusalimschy | 2021-10-11 | 1 | -1/+1 |
| | | | | | Better explanation about the guaranties of multiple assignment in the manual. | ||||
* | Revamp of format validation in 'string.format' | Roberto Ierusalimschy | 2021-09-03 | 1 | -26/+86 |
| | | | | | When calling 'sprintf', not all conversion specifiers accept all flags; some combinations are undefined behavior. | ||||
* | Details | Roberto Ierusalimschy | 2021-05-24 | 1 | -10/+7 |
| | | | | | - Removed unused (and trivial) definition LUA_UNSIGNEDBITS - Alignment structure in pack/unpack moved to a narrower scope | ||||
* | Broadening the use of branch hints | Roberto Ierusalimschy | 2021-02-24 | 1 | -19/+22 |
| | | | | | | More uses of macros 'likely'/'unlikely' (renamed to 'l_likely'/'l_unlikely'), both in range (extended to the libraries) and in scope (extended to hooks, stack growth). | ||||
* | Cleaner handling of floats in pack/unpack | Roberto Ierusalimschy | 2020-12-16 | 1 | -29/+41 |
| | |||||
* | No need for 'volatile' in string.pack/unpack | Roberto Ierusalimschy | 2020-10-12 | 1 | -10/+7 |
| | | | | Type punning an address to 'char *' should be always safe. | ||||
* | Wrong cast in 'str_unpack' | Roberto Ierusalimschy | 2020-09-30 | 1 | -1/+1 |
| | |||||
* | Fixed bug in 'string.format("%p")' | Roberto Ierusalimschy | 2020-03-16 | 1 | -2/+4 |
| | | | | | The string "(null)" used for non-collectable values must be printed as a string, not as a pointer. (Bug introduced in commit e0cbaa50fa7). | ||||
* | Corrected direct use of 'snprintf' in 'lstrlib.c' | Roberto Ierusalimschy | 2020-02-28 | 1 | -1/+1 |
| | |||||
* | Added test for NULL in string.format("%p") | Roberto Ierusalimschy | 2019-12-17 | 1 | -0/+2 |
| | | | | | | ISO C states that standard library functions should not be called with NULL arguments, unless stated otherwise. 'sprintf' does not state otherwise, and it doesn't hurt to be on the safe side. | ||||
* | 'l_mathlim' renamed to 'l_floatatt' | Roberto Ierusalimschy | 2019-12-05 | 1 | -2/+2 |
| | | | | That macro is applied to float attributes, not to limits. | ||||
* | More pious implementation of 'string.dump' | Roberto Ierusalimschy | 2019-10-23 | 1 | -8/+24 |
| | | | | | | | In 'str__dump', the call to 'lua_dump' assumes the function is on the top of the stack, but the manual allows 'luaL_buffinit' to push stuff on the stack (although the current implementation does not). So, the call to 'luaL_buffinit' must come after the call to 'lua_dump'. | ||||
* | Easy redefinition of valid flags for 'string.format' | Roberto Ierusalimschy | 2019-10-17 | 1 | -3/+6 |
| | |||||
* | No coercion string->number in arithmetic with LUA_NOCVTS2N | Roberto Ierusalimschy | 2019-10-08 | 1 | -0/+13 |
| | |||||
* | Added macro 'luaL_pushfail' | Roberto Ierusalimschy | 2019-08-16 | 1 | -2/+2 |
| | | | | | | | | The macro 'luaL_pushfail' documents all places in the standard libraries that return nil to signal some kind of failure. It is defined as 'lua_pushnil'. The manual also got a notation (@fail) to document those returns. The tests were changed to be agnostic regarding whether 'fail' is 'nil' or 'false'. | ||||
* | Fixed bug in 'string.format' with option '%f' | Roberto Ierusalimschy | 2019-07-23 | 1 | -8/+6 |
| | | | | | | | | | | | As an example, 'print(string.format("%.99f", 1e70))' may have a lot of garbage after the number. The old test to ensure that 'string.format("%.99f", n)' was not too large, 'fabs(n) < 1e100', assumes that the number will fit in the 99 bytes; but the 99 is not the space for the number, it is the added extra zeros. The option worked for smaller numbers because of the extra space added to MAX_ITEM. | ||||
* | Avoid using large buffers in 'string.format' | Roberto Ierusalimschy | 2019-04-12 | 1 | -12/+28 |
| | | | | | | | 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. | ||||
* | Small optimizations in 'string.gsub' | Roberto Ierusalimschy | 2019-04-11 | 1 | -46/+84 |
| | | | | | | | | | | | 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). | ||||
* | New conversion specifier '%p' for 'string.format' | Roberto Ierusalimschy | 2019-03-13 | 1 | -0/+5 |
| | | | | | The call 'string.format("%p", val)' gives a Lua equivalent to the C API function 'lua_topointer'. | ||||
* | Details | Roberto Ierusalimschy | 2019-03-13 | 1 | -2/+4 |
| | | | | | | | | | | Several small improvements (code style, warnings, comments, more tests), in particular: - 'lua_topointer' extended to handle strings - raises an error in 'string.format("%10q")' ('%q' with modifiers) - in the manual for 'string.format', the term "option" replaced by "conversion specifier" (the term used by the C standard) | ||||
* | Optional 'init' argument to 'string.gmatch' | Roberto Ierusalimschy | 2019-01-08 | 1 | -24/+52 |
| | | | | | | | | | The function 'string.gmatch' now has an optional 'init' argument, similar to 'string.find' and 'string.match'. Moreover, there was some reorganization in the manipulation of indices in the string library. This commit also includes small janitorial work in the manual and in comments in the interpreter loop. | ||||
* | Detail | Roberto Ierusalimschy | 2018-12-27 | 1 | -2/+1 |
| | | | | Slightly better error message for invalid conversions in 'string.format'. | ||||
* | Better error messages for some polymorphic functions | Roberto Ierusalimschy | 2018-12-10 | 1 | -2/+2 |
| | | | | | | | | | New auxiliary functions/macros 'luaL_argexpected'/'luaL_typeerror' ease the creation of error messages such as bad argument #2 to 'setmetatable' (nil or table expected, got boolean) (The novelty being the "got boolean" part...) | ||||
* | Removed extra information from RCS keyword strings | Roberto Ierusalimschy | 2018-08-23 | 1 | -1/+1 |
| | | | | | Version numbers and dates (mostly wrong) from RCS keyword strings removed from all source files; only the file name are kept. | ||||
* | avoid possible overflows when checking sizes in 'string.unpack' | Roberto Ierusalimschy | 2018-05-25 | 1 | -11/+8 |
| | |||||
* | removed coercion string->number in bitwise operations | Roberto Ierusalimschy | 2018-02-21 | 1 | -59/+1 |
| | | | | (can be done with a Lua module) | ||||
* | using new 'lua_newuserdatauv' instead of 'lua_newuserdata' | Roberto Ierusalimschy | 2018-02-21 | 1 | -2/+2 |
| | |||||
* | detail (typo in comments) | Roberto Ierusalimschy | 2017-11-23 | 1 | -2/+2 |
| | |||||
* | detail ('signal' -> 'sign' in comments) | Roberto Ierusalimschy | 2017-11-16 | 1 | -2/+2 |
| | |||||
* | new function 'luaV_flttointeger' to convert floats to integers (without | Roberto Ierusalimschy | 2017-11-08 | 1 | -9/+71 |
| | | | | | string coercions) + string operands to bitwise operations handled by string metamethods | ||||
* | coercion string->number in arithmetic operations moved to string | Roberto Ierusalimschy | 2017-07-07 | 1 | -2/+86 |
| | | | | library | ||||
* | handling of inf, -inf, and NaN by string.format'%q' | Roberto Ierusalimschy | 2017-05-19 | 1 | -14/+28 |
| | |||||
* | added 'return' to calls to 'luaL_error' (to signal to the compiler | Roberto Ierusalimschy | 2017-03-14 | 1 | -4/+4 |
| | | | | that the function cannot continue past that call) | ||||
* | detail (removing spaces at end of lines) | Roberto Ierusalimschy | 2016-12-22 | 1 | -2/+2 |
| | |||||
* | Using LUAI_UAC* types more consistently on vararg calls | Roberto Ierusalimschy | 2016-12-20 | 1 | -7/+9 |
| | |||||
* | small corrections for C++ compliance | Roberto Ierusalimschy | 2016-06-27 | 1 | -2/+2 |
| | |||||
* | 'string.format("%q")' writes 'math.mininteger' in hexa, to ensure | Roberto Ierusalimschy | 2016-05-20 | 1 | -14/+19 |
| | | | | it is read back as an integer | ||||
* | 'string.pack("cn")' does not accept strings longer than 'n' | Roberto Ierusalimschy | 2016-05-18 | 1 | -8/+6 |
| | |||||
* | comment (FALLTHROUGH) | Roberto Ierusalimschy | 2016-05-13 | 1 | -3/+3 |
| | |||||
* | 'string.format("%q", number)' ensures a dot as decimal point | Roberto Ierusalimschy | 2016-05-02 | 1 | -7/+21 |
| | |||||
* | no more time limits to pattern matching (at least for now) | Roberto Ierusalimschy | 2016-04-22 | 1 | -38/+1 |
| | |||||
* | match time limit defined by variable 'string.pattlimit' | Roberto Ierusalimschy | 2016-04-19 | 1 | -16/+36 |
| | |||||
* | 'string.format"%q"' now works for all basic types (nil, boolean, | Roberto Ierusalimschy | 2016-04-08 | 1 | -6/+36 |
| | | | | numbers, and strings) | ||||
* | LUA_PACKPADBYTE -> LUAL_PACKPADBYTE (it is an internal library | Roberto Ierusalimschy | 2016-04-07 | 1 | -6/+6 |
| | | | | name, not something to be usually configured) | ||||
* | new way to avoid infinite loops in empty matches: "Python rule" | Roberto Ierusalimschy | 2016-03-31 | 1 | -8/+8 |
| | | | | | ("Empty matches for the pattern are replaced only when not adjacent to a previous match") | ||||
* | comments | Roberto Ierusalimschy | 2016-03-23 | 1 | -12/+12 |
| | |||||
* | bug: 'gmatch' iterator fails when called from a coroutine different | Roberto Ierusalimschy | 2016-03-23 | 1 | -5/+4 |
| | | | | from the one that created it | ||||
* | '\0' is a control character, no need to check it explicitly | Roberto Ierusalimschy | 2016-02-25 | 1 | -2/+2 |
| | |||||
* | format "%s" in 'string.format' accepts embedded zeros when itv5.3.2 | Roberto Ierusalimschy | 2015-11-25 | 1 | -9/+12 |
| | | | | has no modifiers |