line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TOML::Parser::Util; |
2
|
20
|
|
|
20
|
|
283
|
use 5.008005; |
|
20
|
|
|
|
|
64
|
|
3
|
20
|
|
|
20
|
|
98
|
use strict; |
|
20
|
|
|
|
|
36
|
|
|
20
|
|
|
|
|
378
|
|
4
|
20
|
|
|
20
|
|
94
|
use warnings; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
603
|
|
5
|
|
|
|
|
|
|
|
6
|
20
|
|
|
20
|
|
343
|
use Exporter 5.57 'import'; |
|
20
|
|
|
|
|
246
|
|
|
20
|
|
|
|
|
4300
|
|
7
|
|
|
|
|
|
|
our @EXPORT_OK = qw/unescape_str/; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub unescape_str { |
10
|
137
|
|
|
137
|
0
|
197
|
my $str = shift; |
11
|
|
|
|
|
|
|
|
12
|
137
|
|
|
|
|
253
|
$str =~ s!\\b !\x08!xmgo; # backspace (U+0008) |
13
|
137
|
|
|
|
|
192
|
$str =~ s!\\t !\x09!xmgo; # tab (U+0009) |
14
|
137
|
|
|
|
|
212
|
$str =~ s!\\n !\x0A!xmgo; # linefeed (U+000A) |
15
|
137
|
|
|
|
|
197
|
$str =~ s!\\f !\x0C!xmgo; # form feed (U+000C) |
16
|
137
|
|
|
|
|
179
|
$str =~ s!\\r !\x0D!xmgo; # carriage return (U+000D) |
17
|
137
|
|
|
|
|
180
|
$str =~ s!\\" !\x22!xmgo; # quote (U+0022) |
18
|
137
|
|
|
|
|
178
|
$str =~ s!\\/ !\x2F!xmgo; # slash (U+002F) |
19
|
137
|
|
|
|
|
186
|
$str =~ s!\\\\!\x5C!xmgo; # backslash (U+005C) |
20
|
137
|
|
|
|
|
180
|
$str =~ s{\\u([0-9A-Fa-f]{4})}{# unicode (U+XXXX) |
21
|
1
|
|
|
|
|
10
|
chr hex $1 |
22
|
|
|
|
|
|
|
}xmgeo; |
23
|
137
|
|
|
|
|
176
|
$str =~ s{\\U([0-9A-Fa-f]{8})}{# unicode (U+XXXXXXXX) |
24
|
1
|
|
|
|
|
9
|
chr hex $1 |
25
|
|
|
|
|
|
|
}xmgeo; |
26
|
|
|
|
|
|
|
|
27
|
137
|
|
|
|
|
374
|
return $str; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
__END__ |