Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-02-18, 07:02 PM   #1
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Need a second set of eyes to spot the error

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:
  1. 3x !Aardvark\Options-Options.lua:18: unexpected symbol near 'local'

And lines 1-30 of my code:
Lua Code:
  1. local Aardvark = LibStub("AceAddon-3.0"):GetAddon("Aardvark")
  2. local L = LibStub("AceLocale-3.0"):GetLocale("Aardvark", false)
  3. local ldbIcon = LibStub("LibDBIcon-1.0")
  4.  
  5. local options = nil
  6. local db
  7. local exempt = {
  8.     -- always allow these addons to print to chat
  9.     ["!Aardvark"] = true,
  10.     ["!Swatter"] = true,
  11.     ["Ace3"] = true,
  12.     ["BugSack"] = true,
  13.     ["Bugger"] = true
  14. }
  15. local OptionsHandler = {} -- local function to this file
  16.  
  17. local AddOnList = {
  18.     local list = {}
  19.     for i = 1, GetNumAddOns() do
  20.         local folderName, title = GetAddOnInfo(i)
  21.         if not exempt[folderName] then
  22.             local index = #list + 1
  23.             list[index] = title
  24.         end
  25.     end
  26.     table.sort(list, function(a, b) -- sort alphabetically
  27.         return a.name > b.name
  28.     end)
  29.     return list
  30. }
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Need a second set of eyes to spot the error


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off