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