diff options
author | sumneko <sumneko@hotmail.com> | 2022-03-12 04:48:33 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2022-03-12 04:48:33 +0800 |
commit | c461d51bf40563c3b74c652d8789ae302ea7c9e1 (patch) | |
tree | efae279e57602aa19bc993dfcd10bd5990959313 /script/parser | |
parent | a4baf8a43b0b25414d8fe08cb898e150d420e705 (diff) | |
download | lua-language-server-c461d51bf40563c3b74c652d8789ae302ea7c9e1.zip |
update
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/guide.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua index 73857149..f490b306 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -1182,4 +1182,25 @@ function m.isOOP(source) return false end +local baseTypeMap = { + ['unknown'] = true, + ['any'] = true, + ['true'] = true, + ['false'] = true, + ['nil'] = true, + ['boolean'] = true, + ['number'] = true, + ['string'] = true, + ['table'] = true, + ['function'] = true, + ['thread'] = true, + ['userdata'] = true, +} + +---@param str string +---@return boolean +function m.isBaseType(str) + return baseTypeMap[str] == true +end + return m |