summaryrefslogtreecommitdiff
path: root/script-beta/parser/guide.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta/parser/guide.lua')
-rw-r--r--script-beta/parser/guide.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index 5e7a731a..32f5107e 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -1387,6 +1387,15 @@ function m.checkSameSimpleAsTableField(status, ref, start, queue)
end
end
+function m.checkBackCount(status)
+ status.cache.back = status.cache.back or 0
+ if status.cache.back >= (status.interface.backlimit or 0) then
+ return true
+ end
+ status.cache.back = status.cache.back + 1
+ return false
+end
+
function m.checkSameSimpleAsReturn(status, ref, start, queue)
if ref.parent.type ~= 'return' then
return
@@ -1396,6 +1405,9 @@ function m.checkSameSimpleAsReturn(status, ref, start, queue)
if ref.parent.parent.type ~= 'main' then
return
end
+ if m.checkBackCount(status) then
+ return
+ end
local newStatus = m.status(status)
m.searchRefsAsFunctionReturn(newStatus, ref, 'ref')
for _, res in ipairs(newStatus.results) do
@@ -1420,6 +1432,9 @@ function m.checkSameSimpleAsSetValue(status, ref, start, queue)
if m.checkValueMark(status, ref, parent) then
return
end
+ if m.checkBackCount(status) then
+ return
+ end
local obj
if parent.type == 'local'
or parent.type == 'setglobal'