[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: table key starting with backslash
- From: Christopher Kappe <nox_diesque@...>
- Date: Fri, 9 Oct 2015 11:36:47 +0200
Hello,
I think I stumbled upon an error in the Lua parser or at least in the
manual.
I want to write a table mapping from special characters given in their
LaTeX representation to the utf8 character. Like this (using the well
known syntactic sugar for string keys):
local latexToUtf8 = {
\\\"a = "ä", -- without escaping: \"a
\\\"o = "ö"
-- etc.
}
This does not compile! However, this works:
local latexToUtf8 = {
["\\\"a"] = "ä",
["\\\"o"] = "ö"
}
This contradicts the following sentence from
http://www.lua.org/manual/5.3/manual.html
A field of the form name = exp is equivalent to ["name"] = exp.
Because all accents combined with all possible letters makes a large
number, this table is going to be quite long, so I would really be happy
if I could save the [""]
Regards
Christopher