1 /**
2 Copyright: Copyright (c) 2016, 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 cpptooling.analyzer.clang.ast.visitor;
11 
12 version (unittest) {
13     import std.algorithm : map, splitter;
14     import std.array : array;
15     import std..string : strip;
16     import unit_threaded : shouldEqual;
17     import test.extra_should : shouldEqualPretty;
18 }
19 
20 /// Inject incr/decr that is called by the accept function when visiting the AST.
21 mixin template generateIndentIncrDecr() {
22     uint indent;
23 
24     override void incr() @safe {
25         ++indent;
26     }
27 
28     override void decr() @safe {
29         --indent;
30     }
31 }
32 
33 @("Should be an instane of a Visitor")
34 unittest {
35     import cpptooling.analyzer.clang.ast.base_visitor;
36 
37     class V2 : Visitor {
38     }
39 
40     auto v = new V2;
41 }