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.OpAssign:
29         goto case;
30     case Kind.OpAssignAdd:
31         goto case;
32     case Kind.OpAssignAndBitwise:
33         goto case;
34     case Kind.OpAssignDiv:
35         goto case;
36     case Kind.OpAssignMod:
37         goto case;
38     case Kind.OpAssignMul:
39         goto case;
40     case Kind.OpAssignOrBitwise:
41         goto case;
42     case Kind.OpAssignSub:
43         goto case;
44     case Kind.Call:
45         rval = [stmtDel];
46         break;
47     default:
48     }
49 
50     return rval;
51 }
52 
53 immutable Mutation.Kind[] stmtDelMutationsRaw;
54 
55 shared static this() {
56     with (Mutation.Kind) {
57         stmtDelMutationsRaw = [stmtDel];
58     }
59 }