forked from silq-lang/silq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.d
78 lines (71 loc) · 1.31 KB
/
options.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Written in the D programming language
// License: http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0
enum Format{
default_,
gnuplot,
matlab,
maple,
mathematica,
python,
sympy,
lisp,
}
enum ErrorFormat{
default_,
json,
}
enum BackendType{
none,
run,
}
enum OutputForm{
default_,
raw,
rawError,
}
enum IntegrationLevel{
full,
deltas,
none,
}
struct Options{
BackendType backend;
bool plot=false;
string plotRange="[-10:10]";
string plotFile="";
bool cdf=false;
bool kill=false;
auto formatting=Format.default_;
auto errorFormat=ErrorFormat.default_;
bool casBench=false;
bool noBoundsCheck=false;
bool noCheck=true;
bool noNormalize=false;
bool trace=false;
bool dumpReverse=false;
bool expectation=false;
IntegrationLevel integrationLevel=IntegrationLevel.full;
OutputForm outputForm;
string[] importPath;
string[] summarize;
ulong numRuns=1;
}
Options opt; // TODO: get rid of global?
struct Expected{
bool exists;
bool todo;
string ex;
}
Expected expected;
string casExt(Format formatting=opt.formatting){
final switch(formatting) with(Format){
case default_: return "dexpr";
case gnuplot: return "gnu";
case matlab: return "m";
case mathematica: return "m";
case maple: return "mpl";
case python: return "py";
case sympy: return "py";
case lisp: return "lisp";
}
}