line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TOML::Parser::Util; |
2
|
20
|
|
|
20
|
|
336
|
use 5.008005; |
|
20
|
|
|
|
|
75
|
|
3
|
20
|
|
|
20
|
|
115
|
use strict; |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
447
|
|
4
|
20
|
|
|
20
|
|
110
|
use warnings; |
|
20
|
|
|
|
|
48
|
|
|
20
|
|
|
|
|
727
|
|
5
|
|
|
|
|
|
|
|
6
|
20
|
|
|
20
|
|
601
|
use Exporter 5.57 'import'; |
|
20
|
|
|
|
|
306
|
|
|
20
|
|
|
|
|
5072
|
|
7
|
|
|
|
|
|
|
our @EXPORT_OK = qw/unescape_str/; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub unescape_str { |
10
|
137
|
|
|
137
|
0
|
225
|
my $str = shift; |
11
|
|
|
|
|
|
|
|
12
|
137
|
|
|
|
|
304
|
$str =~ s!\\b !\x08!xmgo; # backspace (U+0008) |
13
|
137
|
|
|
|
|
222
|
$str =~ s!\\t !\x09!xmgo; # tab (U+0009) |
14
|
137
|
|
|
|
|
220
|
$str =~ s!\\n !\x0A!xmgo; # linefeed (U+000A) |
15
|
137
|
|
|
|
|
232
|
$str =~ s!\\f !\x0C!xmgo; # form feed (U+000C) |
16
|
137
|
|
|
|
|
239
|
$str =~ s!\\r !\x0D!xmgo; # carriage return (U+000D) |
17
|
137
|
|
|
|
|
207
|
$str =~ s!\\" !\x22!xmgo; # quote (U+0022) |
18
|
137
|
|
|
|
|
202
|
$str =~ s!\\/ !\x2F!xmgo; # slash (U+002F) |
19
|
137
|
|
|
|
|
209
|
$str =~ s!\\\\!\x5C!xmgo; # backslash (U+005C) |
20
|
137
|
|
|
|
|
210
|
$str =~ s{\\u([0-9A-Fa-f]{4})}{# unicode (U+XXXX) |
21
|
1
|
|
|
|
|
7
|
chr hex $1 |
22
|
|
|
|
|
|
|
}xmgeo; |
23
|
137
|
|
|
|
|
229
|
$str =~ s{\\U([0-9A-Fa-f]{8})}{# unicode (U+XXXXXXXX) |
24
|
1
|
|
|
|
|
4
|
chr hex $1 |
25
|
|
|
|
|
|
|
}xmgeo; |
26
|
|
|
|
|
|
|
|
27
|
137
|
|
|
|
|
432
|
return $str; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
__END__ |