diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-08-11 21:14:54 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-08-11 21:14:54 +0800 |
commit | a3c0d6ad25dbab739b10d4fe7019a99d4990f62f (patch) | |
tree | 216cfec293bf223fdca1db2b1c17dc1ce34e6d9d /script/core/noder.lua | |
parent | a88c6796f2ab2ac3b3ff2419ab1cfdcb5518013f (diff) | |
download | lua-language-server-a3c0d6ad25dbab739b10d4fe7019a99d4990f62f.zip |
improve
Diffstat (limited to 'script/core/noder.lua')
-rw-r--r-- | script/core/noder.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua index c2f2061a..893c5cac 100644 --- a/script/core/noder.lua +++ b/script/core/noder.lua @@ -13,6 +13,7 @@ local ssub = string.sub local sformat = string.format local sgsub = string.gsub local smatch = string.match +local sfind = string.find _ENV = nil @@ -1380,6 +1381,17 @@ function m.isCommonField(field) return true end +---是否是普通的field,例如数字或字符串,而不是函数返回值等 +function m.hasCall(field) + if not field then + return false + end + if sfind(field, RETURN_INDEX, 1, true) then + return true + end + return false +end + function m.isGlobalID(id) return ssub(id, 1, 2) == 'g:' or ssub(id, 1, 3) == 'dn:' |