diff options
Diffstat (limited to 'script/vm/function.lua')
-rw-r--r-- | script/vm/function.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/script/vm/function.lua b/script/vm/function.lua index 8b996721..5ad12acf 100644 --- a/script/vm/function.lua +++ b/script/vm/function.lua @@ -1,5 +1,6 @@ ---@class vm -local vm = require 'vm.vm' +local vm = require 'vm.vm' +local guide = require 'parser.guide' ---@param arg parser.object ---@return parser.object? @@ -266,3 +267,14 @@ function vm.isVarargFunctionWithOverloads(func) end return false end + +---@param func parser.object +---@return boolean +function vm.isEmptyFunction(func) + if #func > 0 then + return false + end + local startRow = guide.rowColOf(func.start) + local finishRow = guide.rowColOf(func.finish) + return finishRow - startRow <= 1 +end |