From b311bf5b0332518b8c9870d90557ca09eb19ee26 Mon Sep 17 00:00:00 2001 From: sumneko Date: Wed, 3 Apr 2019 18:34:36 +0800 Subject: =?UTF-8?q?=E7=94=9F=E4=B8=8B=E7=9A=84Lua=205.4=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/locale/en-US/libs/lua/math.lni | 14 ++++++++++++++ server/locale/en-US/libs/lua/string.lni | 11 +++++++++++ 2 files changed, 25 insertions(+) (limited to 'server/locale/en-US') diff --git a/server/locale/en-US/libs/lua/math.lni b/server/locale/en-US/libs/lua/math.lni index 1a5ca814..e5bc33b3 100644 --- a/server/locale/en-US/libs/lua/math.lni +++ b/server/locale/en-US/libs/lua/math.lni @@ -65,6 +65,20 @@ description = [[ [randomseed] description = 'Sets `x` as the "seed" for the pseudo-random generator.' +["randomseed Lua 5.4"] +description = [[ +When called with at least one argument, +the integer parameters `x` and `y` are +concatenated into a 128-bit `seed` that +is used to reinitialize the pseudo-random generator; +equal seeds produce equal sequences of numbers. +The default for `y` is zero. + +When called with no arguments, +Lua generates a seed with +a weak attempt for randomness. +]] + [sin] description = 'Returns the sine of `x` (assumed to be in radians).' diff --git a/server/locale/en-US/libs/lua/string.lni b/server/locale/en-US/libs/lua/string.lni index 633afdf8..3c7b987d 100644 --- a/server/locale/en-US/libs/lua/string.lni +++ b/server/locale/en-US/libs/lua/string.lni @@ -24,6 +24,17 @@ end ``` ]] +["gmatch Lua 5.4"] +description = [[ +---------- +```lua +s = "hello world from Lua" +for w in string.gmatch(s, "%a+") do + print(w) +end +``` +]] + [gsub] description = 'Returns a copy of s in which all (or the first `n`, if given) occurrences of the [`pattern`](https://www.lua.org/manual/5.3/manual.html#6.4.1) have been replaced by a replacement string specified by `repl`.' -- cgit v1.2.3