aboutsummaryrefslogtreecommitdiff
path: root/llex.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-10-24Always use unsigned int for indexing table-arraysRoberto Ierusalimschy2-5/+5
2024-10-23New function 'lua_numbertostrbuff'Roberto Ierusalimschy7-40/+67
It converts a Lua number to a string in a buffer, without creating a new Lua string.
2024-10-23Some changes in default GC parametersRoberto Ierusalimschy2-8/+6
2024-10-21Small bug in 'luaE_luaE_statesize'Roberto Ierusalimschy3-4/+4
Plus, function was renamed to 'luaE_threadsize'.
2024-10-21Better support in 'ltests' for tracing the GCRoberto Ierusalimschy5-30/+67
2024-10-18Some adjustments in transition minor->majorRoberto Ierusalimschy2-37/+46
Plus extra comments and other details.
2024-09-30'objsize' broke in smaller piecesRoberto Ierusalimschy9-63/+91
2024-09-27Local declaration in the REPL generates a warningRoberto Ierusalimschy2-2/+25
2024-09-20No errors in 'luaO_pushvfstring'Roberto Ierusalimschy5-24/+45
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.
2024-09-20Towards no errors in 'luaO_pushvfstring'Roberto Ierusalimschy1-52/+69
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.
2024-09-20In 'luaO_pushvfstring', all options use 'addstr2buff'Roberto Ierusalimschy1-12/+8
2024-09-20Removed 'if' left from commit ddfa1fbccfeRoberto Ierusalimschy1-1/+0
2024-09-19Avoid Microsoft warningRoberto Ierusalimschy1-1/+2
> warning C4334: '<<': result of 32-bit shift implicitly converted to > 64 bits (was 64-bit shift intended?)
2024-09-19USHRT_MAX changed to SHRT_MAXRoberto Ierusalimschy2-2/+2
USHRT_MAX does not fit in an 'int' in 16-bit systems.
2024-09-19GC back to controling pace counting bytesRoberto Ierusalimschy11-202/+247
Memory is the resource we want to save. Still to be reviewed again.
2024-09-12DetailsRoberto Ierusalimschy1-3/+3
Fixed comments in sort partition.
2024-09-10Parameter for lua_gc/LUA_GCSTEP changed to 'size_t'Roberto Ierusalimschy3-3/+3
'size_t' is the common type for measuring memory. 'int' can be too small for steps.
2024-09-06Rename of fields in global state that control GCRoberto Ierusalimschy5-32/+32
All fields in the global state that control the pace of the garbage collector prefixed with 'GC'.
2024-09-06DetailsRoberto Ierusalimschy3-20/+20
Identation + comments
2024-08-22Added option for direct correction of stack pointersRoberto Ierusalimschy1-10/+44
The use of a pointer (not access, only for computations) after its deallocation is forbiden in ISO C, but seems to work fine in all platforms we are aware of. So, using that to correct stack pointers after a stack reallocation seems safe and is much simpler than the current implementation (first change all pointers to offsets and then changing the offsets back to pointers). Anyway, for now that option is disabled.
2024-08-20'lcode.c' can use 'checklimit', tooRoberto Ierusalimschy3-12/+10
2024-08-19A return can have at most 254 valuesRoberto Ierusalimschy2-0/+13
2024-08-17Bug: wrong code gen. for indices with comparisonsRoberto Ierusalimschy2-1/+10
In function 'luaK_exp2val', used to generate code for indices: Macro 'hasjumps' does not consider the case when the whole expression is a "jump" (a test). In all other of its uses, the surrounding code ensures that the expression cannot be VJMP.
2024-08-02Floats formatted with "correct" precisionRoberto Ierusalimschy3-21/+153
Conversion float->string ensures that, for any float f, tonumber(tostring(f)) == f, but still avoiding noise like 1.1 converting to "1.1000000000000001".
2024-07-30Struct 'transferinfo' moved to "lua_State"Roberto Ierusalimschy3-24/+16
That reduces the size of "CallInfo". Moreover, bit CIST_HOOKED from call status is not needed. When in a hook, 'transferinfo' is always valid, being zero when the hook is not call/return.
2024-07-27'-Wconversion' extended to all options of Lua numbersRoberto Ierusalimschy8-39/+50
2024-07-27Added gcc option '-Wconversion'Roberto Ierusalimschy44-359/+398
No warnings for standard numerical types. Still pending alternative numerical types.
2024-07-21'nresults' moved into 'callstatus'Roberto Ierusalimschy6-62/+79
That gives us more free bits in 'callstatus', for future use.
2024-07-19Using CIST_CLSRET instead of trick with 'nresults'Roberto Ierusalimschy4-30/+31
The callstatus flag CIST_CLSRET is used in all tests for the presence of variables to be closed in C functions.
2024-07-18Explicit limit for number of results in a callRoberto Ierusalimschy3-4/+17
The parameter 'nresults' in 'lua_call' and similar functions has a limit of 250. It already had an undocumented (and unchecked) limit of SHRT_MAX, but it is seldom larger than 2.
2024-07-16Maximum stack size may not fit in unsigned shortRoberto Ierusalimschy5-28/+46
Therefore, fields ftransfer/ntransfer in lua_Debug must have type 'int'. (Maximum stack size must fit in an 'int'.) Also, this commit adds check that maximum stack size respects size_t for size in bytes.
2024-07-05Removed compatibility with "= exp" in the REPLRoberto Ierusalimschy2-5/+2
2024-07-05Fixed bug in 'multiline'Roberto Ierusalimschy2-14/+19
'incomplete' was popping error message that should be used in case there is no more lines to complete the input, that is, 'pushline' returns NULL, due to end of file.
2024-07-05'printstack' (from ltests.c) made publicRoberto Ierusalimschy2-3/+7
That function is useful for debugging the API.
2024-07-04lua.c loads 'readline' dynamicallyRoberto Ierusalimschy4-29/+90
(See comments in luaconf.h.) This change allows easier compilation, as Lua compiles and works even if the package 'readline' is absent from the system. Moreover, non-interactive uses don't load the library, making the stand-alone slightly faster for small loads.
2024-07-02Small changes in casts from void* to functionsRoberto Ierusalimschy2-22/+26
Macro moved to llimits.h, and casts from void* to lua_CFunction first go through 'voidf' (a pointer to a function from void to void), a kind of void* for functions.
2024-07-01Updated dependencies in the make fileRoberto Ierusalimschy1-15/+23
Mainly to include 'llimits.h' in the non-kernel files
2024-06-28New instruction format for SETLIST/NEWTABLERoberto Ierusalimschy7-47/+97
New instruction format 'ivABC' (a variant of iABC where parameter vC has 10 bits) allows constructors of up to 1024 elements to be coded without EXTRAARG.
2024-06-27'isIT'/'isOT' turned from macros to functionsRoberto Ierusalimschy6-14/+38
2024-06-27Flexible limit for use of registers by constructorsRoberto Ierusalimschy5-7/+31
Instead of a fixed limit of 50 registers (which, in a bad worst case, can limit the nesting of constructors to 5 levels), the compiler computes an individual limit for each constructor based on how many registers are available when it runs. This limit then controls the frequency of SETLIST instructions.
2024-06-26Clearer code for controlling maximum registersRoberto Ierusalimschy3-10/+28
Plus, added a test to check that limit.
2024-06-24Length of external strings must fit in Lua integerRoberto Ierusalimschy4-4/+9
(As the length of any string in Lua.)
2024-06-21Details in the manualRoberto Ierusalimschy1-4/+9
2024-06-21Removed 'int' size limit for string.repRoberto Ierusalimschy2-16/+5
2024-06-21Removed 'int' size limit for pack/unpackRoberto Ierusalimschy2-38/+48
2024-06-21lua_writestring & co. moved to llimits.hRoberto Ierusalimschy4-32/+25
They don't need to be visible by clients of Lua.
2024-06-20llimits.h being used by all Lua codeRoberto Ierusalimschy14-73/+48
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.
2024-06-20Cleaning of llimits.hRoberto Ierusalimschy19-165/+159
Several definitions that don't need to be "global" (that is, that concerns only specific parts of the code) moved out of llimits.h, to more appropriate places.
2024-06-18GC test was not restarting collector after pauseRoberto Ierusalimschy1-1/+2
2024-06-12Tricky _PROMPT may trigger undefined behavior in lua.cRoberto Ierusalimschy1-2/+3