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.lcr;
11 
12 import std.algorithm : filter;
13 
14 import dextool.plugin.mutate.backend.type;
15 import dextool.clang_extensions : OpKind;
16 
17 auto lcrMutations(Mutation.Kind is_a) @safe pure nothrow {
18     return lcrMutationsAll.filter!(a => a != is_a);
19 }
20 
21 immutable Mutation.Kind[OpKind] isLcr;
22 
23 immutable Mutation.Kind[] lcrMutationsAll;
24 
25 shared static this() {
26     // dfmt off
27     with (OpKind) {
28     isLcr = cast(immutable)[
29         LAnd : Mutation.Kind.lcrAnd, // "&&"
30         LOr : Mutation.Kind.lcrOr, // "||"
31         OO_AmpAmp : Mutation.Kind.lcrAnd, // "&&"
32         OO_PipePipe : Mutation.Kind.lcrOr, // "||"
33     ];
34     }
35     // dfmt on
36 
37     with (Mutation.Kind) {
38         lcrMutationsAll = [lcrAnd, lcrOr,];
39     }
40 }