| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
No warnings for standard numerical types. Still pending alternative
numerical types.
|
| |
|
| |
|
|
|
|
| |
They don't need to be visible by clients of Lua.
|
|
|
|
|
|
| |
The definitions in llimits.h are useful not only for the core. That
header only defines types and '#define's, so libs and core still do
not share any real code/data.
|
|
|
|
|
| |
'lua_dump' signals to the writer function the end of a dump, so that
is has more freedom when using the stack.
|
|\ |
|
| |
| |
| |
| | |
Typos in comments and details in the manual.
|
|/
|
|
|
| |
A repeated string in a dump is represented as an index to its first
occurence, instead of another copy of the string.
|
|
|
|
|
| |
Better explanation about the guaranties of multiple assignment in
the manual.
|
|
|
|
|
| |
When calling 'sprintf', not all conversion specifiers accept all
flags; some combinations are undefined behavior.
|
|
|
|
|
| |
- Removed unused (and trivial) definition LUA_UNSIGNEDBITS
- Alignment structure in pack/unpack moved to a narrower scope
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
| |
Type punning an address to 'char *' should be always safe.
|
| |
|
|
|
|
|
| |
The string "(null)" used for non-collectable values must be printed as a
string, not as a pointer. (Bug introduced in commit e0cbaa50fa7).
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
That macro is applied to float attributes, not to limits.
|
|
|
|
|
|
|
| |
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'.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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'.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
| |
The call 'string.format("%p", val)' gives a Lua equivalent to the
C API function 'lua_topointer'.
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Slightly better error message for invalid conversions in 'string.format'.
|
|
|
|
|
|
|
|
|
| |
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...)
|
|
|
|
|
| |
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
|
| |
|
|
|
|
| |
(can be done with a Lua module)
|
| |
|
| |
|
| |
|
|
|
|
|
| |
string coercions) + string operands to bitwise operations handled
by string metamethods
|
|
|
|
| |
library
|
| |
|
|
|
|
| |
that the function cannot continue past that call)
|
| |
|
| |
|
| |
|
|
|
|
| |
it is read back as an integer
|
| |
|
| |
|
| |
|