Line |
Branch |
Exec |
Source |
1 |
|
|
#ifndef LYTHON_EXCEPTION_HEADER |
2 |
|
|
#define LYTHON_EXCEPTION_HEADER |
3 |
|
|
|
4 |
|
|
// Actual method signature is WIP |
5 |
|
|
// most mght become references |
6 |
|
|
|
7 |
|
|
#include "dtypes.h" |
8 |
|
|
#include "native.h" |
9 |
|
|
#include "vm/tree.h" |
10 |
|
|
|
11 |
|
|
namespace lython { |
12 |
|
|
|
13 |
|
|
// Here we make exception hold the stack trace but the stack trace should be held by the VM |
14 |
|
|
// the Exception object is just going to hold some user specified info |
15 |
|
|
struct lyException: public NativeObject { |
16 |
|
|
|
17 |
|
|
lyException(Array<StackTrace> const& traces): traces(traces) {} |
18 |
|
|
|
19 |
|
|
Array<StackTrace> traces; |
20 |
|
|
|
21 |
|
|
// type of the exception |
22 |
|
|
// this is to help with exception matching |
23 |
|
|
ExprNode* type; |
24 |
|
|
|
25 |
|
|
// Custom exception generated |
26 |
|
|
// this is what is created when raise AttributeError(...) |
27 |
|
|
// is called |
28 |
|
|
ConstantValue custom; |
29 |
|
|
}; |
30 |
|
|
} // namespace lython |
31 |
|
|
|
32 |
|
|
#endif |
33 |
|
|
|