diff options
-rw-r--r-- | .vscode/launch.json | 2 | ||||
-rw-r--r-- | .vscode/settings.json | 3 | ||||
-rw-r--r-- | script-beta/parser/guide.lua | 25 |
3 files changed, 18 insertions, 12 deletions
diff --git a/.vscode/launch.json b/.vscode/launch.json index cfb5988b..838f6b24 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -48,7 +48,7 @@ "type": "lua", "request": "attach", "stopOnEntry": true, - "address": "127.0.0.1:11412", + "address": "127.0.0.1:11413", "outputCapture": [ ] }, diff --git a/.vscode/settings.json b/.vscode/settings.json index df636db4..e857db9b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -34,5 +34,6 @@ }, "Lua.plugin.enable": true, "Lua.zzzzzz.cat": true, - "Lua.develop.enable": true + "Lua.develop.enable": true, + "Lua.develop.debuggerPort": 11413 } diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua index a6e0deef..8d7c3d9c 100644 --- a/script-beta/parser/guide.lua +++ b/script-beta/parser/guide.lua @@ -1283,18 +1283,27 @@ function m.checkSameSimpleInGlobal(status, name, start, queue) end end +function m.checkValueMark(status, a, b) + if not status.cache.valueMark then + status.cache.valueMark = {} + end + if status.cache.valueMark[a] + or status.cache.valueMark[b] then + return true + end + status.cache.valueMark[a] = true + status.cache.valueMark[b] = true + return false +end + function m.searchSameFieldsInValue(status, ref, start, queue, mode) local value = m.getObjectValue(ref) if not value then return end - if not status.cache.valueMark then - status.cache.valueMark = {} - end - if status.cache.valueMark[value] then + if m.checkValueMark(status, ref, value) then return end - status.cache.valueMark[value] = true local newStatus = m.status(status) m.searchRefs(newStatus, value, mode) for _, res in ipairs(newStatus.results) do @@ -1368,13 +1377,9 @@ function m.checkSameSimpleAsSetValue(status, ref, start, queue) if m.getObjectValue(parent) ~= ref then return end - if not status.cache.valueMark then - status.cache.valueMark = {} - end - if status.cache.valueMark[ref] then + if m.checkValueMark(status, ref, parent) then return end - status.cache.valueMark[ref] = true local obj if parent.type == 'local' or parent.type == 'setglobal' |