summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/guide.lua21
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