Исправлен недочет, когда отладчик искал возможные переменные в строках

This commit is contained in:
Igor Timofeev
2017-01-20 11:06:46 +03:00
parent 6bedaec9c8
commit 56e3d0a7bd
5 changed files with 15 additions and 8 deletions

View File

@@ -254,15 +254,19 @@ local function showBreakpointMessage(variables)
mainWindow.errorMessage.isHidden = false
mainWindow.errorMessage.errorTextBox:setAlignment(GUI.alignment.horizontal.center, GUI.alignment.vertical.top)
mainWindow.errorMessage.errorTextBox.lines = {
{text = localization.variables, color = 0x0},
" ",
}
mainWindow.errorMessage.errorTextBox.lines = {}
for variable, value in pairs(variables) do
table.insert(mainWindow.errorMessage.errorTextBox.lines, variable .. " = " .. value)
end
if #mainWindow.errorMessage.errorTextBox.lines > 0 then
table.insert(mainWindow.errorMessage.errorTextBox.lines, 1, " ")
table.insert(mainWindow.errorMessage.errorTextBox.lines, 1, {text = localization.variables, color = 0x0})
else
table.insert(mainWindow.errorMessage.errorTextBox.lines, 1, {text = localization.variablesNotAvailable, color = 0x0})
end
calculateErrorMessageSizeAndBeep()
end
@@ -551,15 +555,16 @@ local function getVariables(codePart)
word ~= "nil" and
word ~= "not" and
word ~= "and" and
word ~= "or"
word ~= "or" and
-- А вот это надо на всякий пожарный, вдруг это ебучая строка с дохуяллионом кавычек
not word:match("^\".+\"$")
then
-- Затем извлекаем из наших слов куски без всяких хитрожопых символов, оставляя лишь буковки с циферками
for variable in word:gmatch("[^%[%]%{%}%(%)%;%,%=%+%-%*%/%^%%%>%<]+") do
-- Попутно чекаем, не является ли этот кусок числом или строкой
-- Попутно чекаем, не является ли этот кусок числом
if
not variable:match("^%d+$") and
not variable:match("^0x%x+$") and
not variable:match("^\".+\"$")
not variable:match("^0x%x+$")
then
variables[variable] = true
end