line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#pragma once |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
#include |
4
|
|
|
|
|
|
|
#include |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
namespace xs { |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
using CatchHandlerSimple = std::function; |
9
|
|
|
|
|
|
|
using CatchHandler = std::function; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
using ExceptionProcessor = std::function; |
12
|
|
|
|
|
|
|
using ExceptionProcessorSimple = std::function; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
void add_catch_handler (CatchHandlerSimple f); |
15
|
|
|
|
|
|
|
void add_catch_handler (CatchHandler f); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
void add_exception_processor(ExceptionProcessor f); |
18
|
|
|
|
|
|
|
void add_exception_processor(ExceptionProcessorSimple f); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Sv _exc2sv (const Sub&); |
21
|
|
|
|
|
|
|
|
22
|
703
|
|
|
|
|
|
template static inline auto throw_guard (CV* context, F&& f) -> decltype(f()) { |
23
|
|
|
|
|
|
|
SV* exc; |
24
|
703
|
50
|
|
|
|
|
try { return f(); } |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
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