It's a syntax issue -- you're not supposed to use a colon to separate the key from the value in a table. The correct character is an equals sign:
local messages = {
message1 = " Some message",
message2 = " Some message2",
}
I believe "<name> expected" is referencing OOP style calls like SomeObject:someMethod(), (the only use of the colon in Lua that I can recall of the top of my head), as if you wrote :someMethod() without any object name in front, but Lua expects a object name there.