https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
|
decodeEscapes ('\\':c:cs) = |
|
case c of |
|
'a' -> '\a' : rest |
|
'b' -> '\b' : rest |
|
'e' -> '\x1B' : rest |
|
'f' -> '\f' : rest |
|
'n' -> '\n' : rest |
|
'r' -> '\r' : rest |
|
't' -> '\t' : rest |
|
'v' -> '\v' : rest |
|
'\'' -> '\'' : rest |
|
'"' -> '"' : rest |
|
'\\' -> '\\' : rest |
|
'x' -> |
|
case cs of |
|
(x:y:more) | isHexDigit x && isHexDigit y -> |
|
chr (16*(digitToInt x) + (digitToInt y)) : decodeEscapes more |
|
(x:more) | isHexDigit x -> |
|
chr (digitToInt x) : decodeEscapes more |
|
more -> '\\' : 'x' : decodeEscapes more |
|
_ | isOctDigit c -> |
|
let (digits, more) = spanMax isOctDigit 3 (c:cs) |
|
num = (parseOct digits) `mod` 256 |
|
in (chr num) : decodeEscapes more |
|
_ -> '\\' : c : rest |
Here the followings are missed:
\E: An escape character (not in ANSI C)
\?: question mark
\uHHHH: The Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHH (one to four hex digits)
\UHHHHHHHH: The Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHHHHHH (one to eight hex digits)
\cx: A control-x character
https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
shellcheck/src/ShellCheck/ASTLib.hs
Lines 407 to 431 in 766a836
Here the followings are missed:
\E: An escape character (not in ANSI C)\?: question mark\uHHHH: The Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHH (one to four hex digits)\UHHHHHHHH: The Unicode (ISO/IEC 10646) character whose value is the hexadecimal value HHHHHHHH (one to eight hex digits)\cx: A control-x character