fork/helix

git clone https://git.julia.blue/fork/helix

Daniel EbertRun indentation tests on a part of the Helix source code. Add C++ indent test file.b315901c

master
1.0 KiB48 linesraw
1std::vector<std::string>
2fn_with_many_parameters(int parm1, long parm2, float parm3, double parm4,
3                        char* parm5, bool parm6);
4
5std::vector<std::string>
6fn_with_many_parameters(int parm1, long parm2, float parm3, double parm4,
7                        char* parm5, bool parm6) {
8  auto lambda = []() {
9    return 0;
10  };
11  auto lambda_with_a_really_long_name_that_uses_a_whole_line
12    = [](int some_more_aligned_parameters,
13         std::string parm2) {
14      do_smth();
15    };
16  if (brace_on_same_line) {
17    do_smth();
18  } else if (brace_on_next_line)
19  {
20    do_smth();
21  } else if (another_condition) {
22    do_smth();
23  }
24  else {
25    do_smth();
26  }
27  if (inline_if_statement)
28    do_smth();
29  if (another_inline_if_statement)
30    return [](int parm1, char* parm2) {
31      this_is_a_really_pointless_lambda();
32    };
33
34  switch (var) {
35  case true:
36    return -1;
37  case false:
38    return 42;
39  }
40}
41
42class MyClass : public MyBaseClass {
43public:
44  MyClass();
45  void public_fn();
46private:
47  super_secret_private_fn();
48}