Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | 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 | ||||
* | ensure argument to 'string.format("%s")' does not contain zeros | Roberto Ierusalimschy | 2015-11-23 | 1 | -1/+2 |
| | |||||
* | corrected comparisons of signed (int) with unsigned (size_t) | Roberto Ierusalimschy | 2015-10-29 | 1 | -3/+3 |
| | |||||
* | option 'c' in 'string.pack' accepts any string size (truncating | Roberto Ierusalimschy | 2015-10-28 | 1 | -3/+8 |
| | | | | if larger and padding if smaller) | ||||
* | detail (removed unreacheable 'break') | Roberto Ierusalimschy | 2015-10-08 | 1 | -2/+2 |
| | |||||
* | 'gmatch' keeps its state in a userdata (keeping the same 'MatchState' | Roberto Ierusalimschy | 2015-09-28 | 1 | -20/+26 |
| | | | | across calls) | ||||
* | implemented counter to abort non-linear behavior in pattern matching | Roberto Ierusalimschy | 2015-09-26 | 1 | -26/+46 |
| | |||||
* | in 'lua_number2strx', use the call to 'l_sprintf' to add exponent | Roberto Ierusalimschy | 2015-07-20 | 1 | -4/+3 |
| | | | | to result directly | ||||
* | buffer size changed from size_t to int (it is always small) + | Roberto Ierusalimschy | 2015-06-24 | 1 | -7/+10 |
| | | | | comments + assert that printf result fits in given buffer | ||||
* | using 'snprintf' in C99 (both for documentation of buffer sizes | Roberto Ierusalimschy | 2015-06-18 | 1 | -16/+18 |
| | | | | and some complains from tools) | ||||
* | new configuration macro 'l_mathlim' (simplifies some dependencies | Roberto Ierusalimschy | 2015-05-20 | 1 | -10/+7 |
| | | | | on float type) | ||||
* | more consistent use of locale radix character across Lua | Roberto Ierusalimschy | 2015-04-03 | 1 | -2/+3 |
| | |||||
* | details (avoid 'lint' warnings) | Roberto Ierusalimschy | 2015-03-28 | 1 | -12/+12 |
| | |||||
* | detail | Roberto Ierusalimschy | 2015-02-09 | 1 | -2/+2 |
| | |||||
* | detail | Roberto Ierusalimschy | 2015-02-05 | 1 | -2/+2 |
| | |||||
* | make buffer for format specification a little larger (length modifier | Roberto Ierusalimschy | 2015-02-04 | 1 | -3/+2 |
| | | | | can be larger than 2, e.g. "I64") | ||||
* | own implementation for 'string.format("%a")' for C89 platforms | Roberto Ierusalimschy | 2015-02-04 | 1 | -3/+84 |
| | |||||
* | BUG (when compiled with long double): buffer overflow when formatting | Roberto Ierusalimschy | 2015-01-13 | 1 | -5/+11 |
| | | | | string.format("%.99f", 1e4930) |