Patterns

6.4.1 – Patterns Patterns in Lua are described by regular strings, which are interpreted as patterns by the pattern-matching functions string.find, string.gmatch, string.gsub, and string.match. This section describes the syntax and the meaning (that is, what they match) of these strings. Character Class: A character class is used to represent a set of characters. The following combinations are allowed in describing a character class: x: (where x is not one of the magic characters ^$()%.[]

Concatenation

3.4.6 – Concatenation The string concatenation operator in Lua is denoted by two dots ('..'). If both operands are strings or numbers, then they are converted to strings according to the rules described in §3.4.3. Otherwise, the __concat metamethod is called (see §2.4).

debug.getregistry()

debug.getregistry () Returns the registry table (see §4.5).

math.fmod()

math.fmod (x, y) Returns the remainder of the division of x by y that rounds the quotient towards zero. (integer/float)

luaL_testudata

luaL_testudata[-0, +0, m] void *luaL_testudata (lua_State *L, int arg, const char *tname); This function works like luaL_checkudata, except that, when the test fails, it returns NULL instead of raising an error.

luaL_dostring

luaL_dostring[-0, +?, –] int luaL_dostring (lua_State *L, const char *str); Loads and runs the given string. It is defined as the following macro: (luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0)) It returns false if there are no errors or true in case of errors.

math.ceil()

math.ceil (x) Returns the smallest integral value larger than or equal to x.

lua_pushlightuserdata

lua_pushlightuserdata[-0, +1, –] void lua_pushlightuserdata (lua_State *L, void *p); Pushes a light userdata onto the stack. Userdata represent C values in Lua. A light userdata represents a pointer, a void*. It is a value (like a number): you do not create it, it has no individual metatable, and it is not collected (as it was never created). A light userdata is equal to "any" light userdata with the same C address.

lua_remove

lua_remove[-1, +0, –] void lua_remove (lua_State *L, int index); Removes the element at the given valid index, shifting down the elements above this index to fill the gap. This function cannot be called with a pseudo-index, because a pseudo-index is not an actual stack position.

luaL_prepbuffer

luaL_prepbuffer[-?, +?, m] char *luaL_prepbuffer (luaL_Buffer *B); Equivalent to luaL_prepbuffsize with the predefined size LUAL_BUFFERSIZE.