def _unescape(v):
i = <NUM_LIT:0><EOL>backslash = False<EOL>while i < len(v):<EOL><INDENT>if backslash:<EOL><INDENT>backslash = False<EOL>if v[i] in _escapes:<EOL><INDENT>v = v[:i - <NUM_LIT:1>] + _escape_to_escapedchars[v[i]] + v[i + <NUM_LIT:1>:]<EOL><DEDENT>elif v[i] == '<STR_LIT:\\>':<EOL><INDENT>v = v[:i - <NUM_LIT:1>] + v[i:]<EOL><DEDENT>elif v[i] == '<STR_LIT:u>' or v[i] == '<STR_LIT>':<EOL><INDENT>i += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>raise TomlDecodeError("<STR_LIT>")<EOL><DEDENT>continue<EOL><DEDENT>elif v[i] == '<STR_LIT:\\>':<EOL><INDENT>backslash = True<EOL><DEDENT>i += <NUM_LIT:1><EOL><DEDENT>return v<EOL>
Unescape characters in a TOML string.