| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
The few UTF-8 test files are commented as such, and there is only one
non UTF-8 test file (to test non UTF-8 sources).
|
|
|
|
|
| |
Test files are more polite regarding the use of globals when locals
would do, and when globals are necessary deleting them after use.
|
|
|
|
|
| |
Subtracting a small non-negative int from a non-negative int cannot
overflow, and adding a non-negative int to INT_MIN cannot overflow.
|
| |
|
|
|
|
|
|
|
|
| |
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'.
|
|
|
|
|
|
|
| |
Attributes changed to posfixed ('x <const>', instead of '<const> x'),
and "toclose" renamed to "close". Posfixed attributes seem to make it
clearer that it applies to only one variable when there are multiple
variables.
|
|
|
|
|
|
| |
- Range in date table extended to full 32 bits.
- Easier support for times represented as floats.
- Added more tests.
|
|
|
|
|
|
|
|
| |
In the generic for loop, it is simpler for OP_TFORLOOP to use the
same 'ra' as OP_TFORCALL. Moreover, the internal names of the loop
temporaries "(for ...)" don't need to leak internal details (even
because the numerical for loop doesn't have a fixed role for each of
its temporaries).
|
|
|
|
|
| |
A variable can be declared const, which means it cannot be assigned to,
with the syntax 'local <const> name = exp'.
|
|
|
|
|
|
|
| |
The flag for to-be-closed variables was changed from '*toclose'
to '<toclose>'. Several people found confusing the old syntax and
the new one has a clear terminator, making it more flexible for
future changes.
|
|
|
|
|
| |
The field 'isdst' can be false, so we cannot test its absence with
'if not D.isdst'; we must compare with nil for a correct test.
|
|
|
|
|
| |
The field 'isdst' in date tables may not be present; portable tests
should not assume it is.
|
|
|
|
|
|
|
|
|
| |
The variable to be closed in a generic 'for' loop now is the
4th value produced in the loop initialization, instead of being
the loop state (the 2nd value produced). That allows a loop to
use a state with a '__toclose' metamethod but do not close it.
(As an example, 'f:lines()' might use the file 'f' as a state
for the loop, but it should not close the file when the loop ends.)
|
|
|
|
|
|
|
| |
The new syntax is <local *toclose x = f()>. The mark '*' allows other
attributes to be added later without the need of new keywords; it
also allows better error messages. The API function was also renamed
('lua_tobeclosed' -> 'lua_toclose').
|
|
|
|
|
|
|
|
|
|
|
| |
The implicit variable 'state' in a generic 'for' is marked as a
to-be-closed variable, so that the state will be closed as soon
as the loop ends, no matter how.
Taking advantage of this new facility, the call 'io.lines(filename)'
now returns the open file as a second result. Therefore,
an iteraction like 'for l in io.lines(name)...' will close the
file even when the loop ends with a break or an error.
|
| |
|
|
|
|
|
|
|
| |
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'.
|
|
|