From c461d51bf40563c3b74c652d8789ae302ea7c9e1 Mon Sep 17 00:00:00 2001 From: sumneko Date: Sat, 12 Mar 2022 04:48:33 +0800 Subject: update --- script/parser/guide.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'script/parser') 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 -- cgit v1.2.3