Search results
Results from the WOW.Com Content Network
Print/export Download as PDF; ... text Lua source code to lex.-- @return ... start = pos return tk end local function newline lines ...
Functions can return any kind of value — including a function. This is a powerful feature that can readily confuse the beginner. If you set a = mw. ustring. gmatch (text, "(.)"), the result assigned to a will be a function, not a string character!
Main page; Contents; Current events; Random article; About Wikipedia; Contact us; Pages for logged out editors learn more
Spaces within a formula must be directly managed (for example by including explicit hair or thin spaces). Variable names must be italicized explicitly, and superscripts and subscripts must use an explicit tag or template. Except for short formulas, the source of a formula typically has more markup overhead and can be difficult to read.
Scribunto Lua reference manual; Programming in Lua; Introduction to Lua patterns; About regex. Lua "patterns" are based on Regex (Patterns are a reduced set of regex). Help:Lua metamodules: Lua in Wikipedia has several meta-modules available that can make core functions easily available.
Splits a string into chunks at the specified delimiter, and returns the first (or user-specified) chunk. This is non-Unicode-aware implementation of mw.text.split which, for ASCII-only text, can be up to 60 times faster. 1 (or text) – the text to be split; 2 (or pattern) – the pattern to use when splitting
While this page doesn't currently have anything to say about semicolons, in Lua code they're generally avoided except when necessary (i.e. a statement ending with a function call is followed by a statement starting with a parenthesized expression) or when multiple statements are on a line.
Lua (as of 5.1) provides a limited form of multiple quoting, particularly to allow nesting of long comments or embedded strings. Normally one uses [[ and ]] to delimit literal strings (initial newline stripped, otherwise raw), but the opening brackets can include any number of equal signs, and only closing brackets with the same number of signs ...