Branch
Hash :
e5cfdb4a
Author :
Date :
2021-03-17T11:21:02
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
$'1\a2\b3\c4\e5\f6\n7\r8\t9\v'
$'1234\056789'
$'123\456789'
"abc\xdef"
"\uABCDEFG"
"a\"b"
'1\a2\b3\c4\e5\f6\n7\r8\t9\v'
----------------------------------------------------
[
["string", [
"$'1",
["entity", "\\a"],
"2",
["entity", "\\b"],
"3",
["entity", "\\c"],
"4",
["entity", "\\e"],
"5",
["entity", "\\f"],
"6",
["entity", "\\n"],
"7",
["entity", "\\r"],
"8",
["entity", "\\t"],
"9",
["entity", "\\v"],
"'"
]],
["string", [
"$'1234",
["entity", "\\056"],
"789'"
]],
["string", [
"$'123",
["entity", "\\456"],
"789'"
]],
["string", [
"\"abc",
["entity", "\\xde"],
"f\""
]],
["string", [
"\"",
["entity", "\\uABCD"],
"EFG\""
]],
["string", [
"\"a",
["entity", "\\\""],
"b\""
]],
["string", "'1\\a2\\b3\\c4\\e5\\f6\\n7\\r8\\t9\\v'"]
]
----------------------------------------------------
Checks for entities in strings, mainly according to echo and printf's manuals.
Note that in some cases (“\x”, “\u”…) there's a limit to the number of
characters that can be used afterwards to specify the bytes, etc.