I am getting an "unexpected symbol near 'local'" error, and for the life of me, I can't see the thing. Is the word "list" a bad name for a variable in Lua and I missed the memo?
Full error:
Lua Code:
3x !Aardvark\Options-Options.lua:18: unexpected symbol near 'local'
And lines 1-30 of my code:
Lua Code:
local Aardvark = LibStub("AceAddon-3.0"):GetAddon("Aardvark")
local L = LibStub("AceLocale-3.0"):GetLocale("Aardvark", false)
local ldbIcon = LibStub("LibDBIcon-1.0")
local options = nil
local db
local exempt = {
-- always allow these addons to print to chat
["!Aardvark"] = true,
["!Swatter"] = true,
["Ace3"] = true,
["BugSack"] = true,
["Bugger"] = true
}
local OptionsHandler = {} -- local function to this file
local AddOnList = {
local list = {}
for i = 1, GetNumAddOns() do
local folderName, title = GetAddOnInfo(i)
if not exempt[folderName] then
local index = #list + 1
list[index] = title
end
end
table.sort(list, function(a, b) -- sort alphabetically
return a.name > b.name
end)
return list
}