errors and warnings / parsing / E0105
E0105 error
Invalid escape in a backtick string
- area
- parsing (x01xx)
- fails the build
- yes
A backtick string contains an escape it doesn't know. Backtick strings take
Lua's escapes (\n, \t, \\, \", \ddd, …) plus \{, \}, \`,
\xXX (two hex digits), \u{XXXX} and \z; anything else, such as \q or
the \A of a WoW path, is an error. Quoted strings keep Lua 5.1's rule, where
an unknown escape yields the character itself, so the same text may work in
"…" and fail in a backtick string. Write \\ for a backslash.
Example
local name = "MyAddon"print(`{name} lives in Interface\AddOns`)local name = "MyAddon"print(`{name} lives in Interface\\AddOns`)The compiler reports it like this:
error[E0105]: invalid escape `\A` in a backtick string ┌─ src/main.wowlua:2:33 │ 2 │ print(`{name} lives in Interface\AddOns`) │ ^^ here
Related codes
| code | message |
|---|---|
| E0116 | Unbalanced } in an interpolated string |
Offline
$ wowlua explain E0105 E0105 (error): Invalid escape in a backtick string