| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Comments, small changes in the manual, an extra test for errors in
error handling, small changes in tests.
|
|
|
|
|
| |
Plus some other details. (Option '-Wuninitialized' was removed from
the makefile because it is already enabled by -Wall.)
|
|
|
|
|
| |
It converts a Lua number to a string in a buffer, without creating
a new Lua string.
|
|
|
|
|
|
| |
Any call to 'va_start' must have a corresponding call to 'va_end';
so, functions called between them (luaO_pushvfstring in particular)
cannot raise errors.
|
|
|
|
|
|
| |
Any call to 'va_start' must have a corresponding call to 'va_end';
so, functions called between them (luaO_pushvfstring in particular)
cannot raise errors.
|
| |
|
|
|
|
| |
Memory is the resource we want to save. Still to be reviewed again.
|
|
|
|
|
|
| |
Conversion float->string ensures that, for any float f,
tonumber(tostring(f)) == f, but still avoiding noise like 1.1
converting to "1.1000000000000001".
|
|
|
|
|
| |
No warnings for standard numerical types. Still pending alternative
numerical types.
|
| |
|
|
|
|
|
|
| |
- back with step size in collectgarbage("step")
- adjustments in defaults for some GC parameters
- adjustments in 'luaO_codeparam'
|
|
|
|
|
| |
This encoding brings more precision and a larger range for these
parameters.
|
|
|
|
|
| |
We may want to add other string variants in the future; this change
documents better where the code may need to handle those variants.
|
|
|
|
|
| |
That will allow to change pointers to offsets while reallocating
the stack.
|
| |
|
| |
|
|
|
|
| |
Warnings with clang when using long double for Lua floats.
|
|
|
|
|
|
|
|
| |
The allocation of a userdata for the state of the warn system can
cause a panic if it fails; 'luaL_ref' also can fail. This commit
re-implements the warn system so that it does not need an explicit
state. Instead, the system uses different functions to represent
the different states.
|
|
|
|
| |
Comments in makefile and function 'l_str2d'.
|
|
|
|
|
| |
Several of its callers needed that case and had to do the check
themselves.
|
|
|
|
|
| |
The function 'lua_pushfstring' is seldom called with large strings,
there is no need to optimize too much for that cases.
|
|
|
|
|
|
| |
With MMBIN instructions, there are fewer opcodes that need to update
'L->top', so that change does not seem to pay for the increased
complexity.
|
|
|
|
|
|
|
| |
Instead of updating 'L->top' in every place that may call a
metamethod, the metamethod functions themselves (luaT_trybinTM and
luaT_callorderTM) correct the top. (When calling metamethods from
the C API, however, the callers must preserve 'L->top'.)
|
|
|
|
|
|
| |
OP_NEWTABLE is followed by an OP_EXTRAARG, so that it can keep
the exact size of the array part of the table to be created.
(Functions 'luaO_int2fb'/'luaO_fb2int' were removed.)
|
|
|
|
|
| |
Several small changes from feedback on 5.4 alhpa rc1 (warnings,
typos in the manual, and the like)
|
|
|
|
|
|
|
| |
- 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'
|
|
|
|
|
|
|
|
| |
- '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
|
|
|
|
|
|
|
| |
Details:
- counter 'pushed' moved to the struct 'BuffFS'
- new auxiliar function 'getbuff' to build strings directly on
the buffer.
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
All UTF-8 encoding functionality (including the escape
sequence '\u') accepts all values from the original UTF-8
specification (with sequences of up to six bytes).
By default, the decoding functions in the UTF-8 library do not
accept invalid Unicode code points, such as surrogates. A new
parameter 'nonstrict' makes them accept all code points up to
(2^31)-1, as in the original UTF-8 specification.
|
|
|
|
|
|
|
| |
The repetitive code of the arithmetic and bitwise operators in
the main iterpreter loop was moved to appropriate macros.
(As a detail, the function 'luaV_div' was renamed 'luaV_idiv',
as it does an "integer division" (floor division).
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Version numbers and dates (mostly wrong) from RCS keyword strings
removed from all source files; only the file name are kept.
|
|
|
|
| |
(now uses static variables)
|
|
|
|
| |
(less error cases in the API)
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
string coercions) + string operands to bitwise operations handled
by string metamethods
|
| |
|
|
|
|
| |
library
|
|
|
|
| |
(we may want to put extra info there in the future)
|
|
|
|
| |
(nobody calls it with L==NULL)
|
|
|
|
| |
the kernel
|
| |
|
| |
|
|
|
|
| |
(Therefore, they will be converted as floats)
|