1 /**
2 Copyright: Copyright (c) 2018, Joakim Brännström. All rights reserved.
3 License: MPL-2
4 Author: Joakim Brännström (joakim.brannstrom@gmx.com)
5 
6 This Source Code Form is subject to the terms of the Mozilla Public License,
7 v.2.0. If a copy of the MPL was not distributed with this file, You can obtain
8 one at http://mozilla.org/MPL/2.0/.
9 */
10 module dextool.plugin.mutate.backend.mutation_type.sdl;
11 
12 import dextool.plugin.mutate.backend.type;
13 
14 import dextool.plugin.mutate.backend.analyze.ast;
15 
16 Mutation.Kind[] stmtDelMutations() @safe pure nothrow {
17     return stmtDelMutationsRaw.dup;
18 }
19 
20 Mutation.Kind[] stmtDelMutations(Kind operator) @safe pure nothrow {
21     Mutation.Kind[] rval;
22 
23     switch (operator) with (Mutation.Kind) {
24     case Kind.Return:
25         goto case;
26     case Kind.Block:
27         goto case;
28     case Kind.Loop:
29         goto case;
30     case Kind.BranchBundle:
31         goto case;
32     case Kind.Branch:
33         goto case;
34     case Kind.BinaryOp:
35         goto case;
36     case Kind.OpAssign:
37         goto case;
38     case Kind.OpAssignAdd:
39         goto case;
40     case Kind.OpAssignAndBitwise:
41         goto case;
42     case Kind.OpAssignDiv:
43         goto case;
44     case Kind.OpAssignMod:
45         goto case;
46     case Kind.OpAssignMul:
47         goto case;
48     case Kind.OpAssignOrBitwise:
49         goto case;
50     case Kind.OpAssignSub:
51         goto case;
52     case Kind.Call:
53         rval = [stmtDel];
54         break;
55     default:
56     }
57 
58     return rval;
59 }
60 
61 immutable Mutation.Kind[] stmtDelMutationsRaw;
62 
63 shared static this() {
64     with (Mutation.Kind) {
65         stmtDelMutationsRaw = [stmtDel];
66     }
67 }