diff options
author | Michael Martin <3277009+flrgh@users.noreply.github.com> | 2022-01-19 16:15:46 -0800 |
---|---|---|
committer | Michael Martin <3277009+flrgh@users.noreply.github.com> | 2022-01-19 16:15:46 -0800 |
commit | 4a998891a268d6eb899cb42685bcddc12db8b837 (patch) | |
tree | 98aac056fd0853ca50466820e90439c362a5aaa9 /meta/3rd | |
parent | 45373e5d80ffedf01bf3fe26048cbda48333d386 (diff) | |
download | lua-language-server-4a998891a268d6eb899cb42685bcddc12db8b837.zip |
add annotations for resty.core.regex
Diffstat (limited to 'meta/3rd')
-rw-r--r-- | meta/3rd/OpenResty/library/resty.core.regex.lua | 64 |
1 files changed, 54 insertions, 10 deletions
diff --git a/meta/3rd/OpenResty/library/resty.core.regex.lua b/meta/3rd/OpenResty/library/resty.core.regex.lua index 31cb7915..4876d1de 100644 --- a/meta/3rd/OpenResty/library/resty.core.regex.lua +++ b/meta/3rd/OpenResty/library/resty.core.regex.lua @@ -1,11 +1,55 @@ ---@meta -local resty_core_regex={} -function resty_core_regex.collect_captures(compiled, rc, subj, flags, res) end -function resty_core_regex.set_buf_grow_ratio(ratio) end -function resty_core_regex.re_sub_compile(regex, opts, replace, fun) end -function resty_core_regex.is_regex_cache_empty() end -function resty_core_regex.check_buf_size(buf, buf_size, pos, len, new_len, must_alloc) end -function resty_core_regex.re_match_compile(regex, opts) end -function resty_core_regex.destroy_compiled_regex(compiled) end -resty_core_regex.version = require("resty.core.base").version -return resty_core_regex
\ No newline at end of file + +---@class resty.core.regex +---@field no_pcre boolean +local regex = {} + +---@param ratio integer +function regex.set_buf_grow_ratio(ratio) end + +---@return boolean is_empty +function regex.is_regex_cache_empty() end + +---@class resty.core.regex.compiled : ffi.cdata* +---@field captures ffi.cdata* +---@field ncaptures integer +---@field name_count integer +---@field name_table ffi.cdata* +---@field name_entry_size integer + +---@param compiled resty.core.regex.compiled +---@param flags integer +---@param res ngx.re.captures +function regex.collect_captures(compiled, flags, res) end + +---@param compiled resty.core.regex.compiled +function regex.destroy_compiled_regex(compiled) end + +---@param re string +---@param opts ngx.re.options +---@return resty.core.regex.compiled? compiled +---@return boolean|string compile_once_or_error +---@return integer? flags +function regex.re_match_compile(re, opts) end + +---@param buf ffi.cdata* +---@param buf_size integer +---@param pos integer +---@param len integer +---@param new_len integer +---@param must_alloc boolean +---@return ffi.cdata* buf +---@return integer buf_size +---@return integer new_len +function regex.check_buf_size(buf, buf_size, pos, len, new_len, must_alloc) end + +---@param re string +---@param opts ngx.re.options +---@param replace? string +---@param func? fun(match:string):string +---@return resty.core.regex.compiled? compiled +---@return boolean|string compile_once_or_error +---@return integer? flags +function regex.re_sub_compile(re, opts, replace, func) end + +return regex
\ No newline at end of file |