line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TOML::Parser::Util; |
2
|
20
|
|
|
20
|
|
683
|
use 5.008005; |
|
20
|
|
|
|
|
62
|
|
3
|
20
|
|
|
20
|
|
95
|
use strict; |
|
20
|
|
|
|
|
34
|
|
|
20
|
|
|
|
|
324
|
|
4
|
20
|
|
|
20
|
|
81
|
use warnings; |
|
20
|
|
|
|
|
29
|
|
|
20
|
|
|
|
|
500
|
|
5
|
|
|
|
|
|
|
|
6
|
20
|
|
|
20
|
|
332
|
use Exporter 5.57 'import'; |
|
20
|
|
|
|
|
233
|
|
|
20
|
|
|
|
|
4416
|
|
7
|
|
|
|
|
|
|
our @EXPORT_OK = qw/unescape_str/; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub unescape_str { |
10
|
137
|
|
|
137
|
0
|
188
|
my $str = shift; |
11
|
|
|
|
|
|
|
|
12
|
137
|
|
|
|
|
258
|
$str =~ s!\\b !\x08!xmgo; # backspace (U+0008) |
13
|
137
|
|
|
|
|
178
|
$str =~ s!\\t !\x09!xmgo; # tab (U+0009) |
14
|
137
|
|
|
|
|
184
|
$str =~ s!\\n !\x0A!xmgo; # linefeed (U+000A) |
15
|
137
|
|
|
|
|
177
|
$str =~ s!\\f !\x0C!xmgo; # form feed (U+000C) |
16
|
137
|
|
|
|
|
218
|
$str =~ s!\\r !\x0D!xmgo; # carriage return (U+000D) |
17
|
137
|
|
|
|
|
177
|
$str =~ s!\\" !\x22!xmgo; # quote (U+0022) |
18
|
137
|
|
|
|
|
172
|
$str =~ s!\\/ !\x2F!xmgo; # slash (U+002F) |
19
|
137
|
|
|
|
|
181
|
$str =~ s!\\\\!\x5C!xmgo; # backslash (U+005C) |
20
|
137
|
|
|
|
|
204
|
$str =~ s{\\u([0-9A-Fa-f]{4})}{# unicode (U+XXXX) |
21
|
1
|
|
|
|
|
8
|
chr hex $1 |
22
|
|
|
|
|
|
|
}xmgeo; |
23
|
137
|
|
|
|
|
164
|
$str =~ s{\\U([0-9A-Fa-f]{8})}{# unicode (U+XXXXXXXX) |
24
|
1
|
|
|
|
|
3
|
chr hex $1 |
25
|
|
|
|
|
|
|
}xmgeo; |
26
|
|
|
|
|
|
|
|
27
|
137
|
|
|
|
|
354
|
return $str; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
__END__ |