summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.76.0/src/align_oc_msg_spec.cpp
blob: 88671254c8cb5f05d81356559f6b795ec1cd6fa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
 * @file align_oc_msg_spec.cpp
 *
 * @author  Guy Maurel
 * split from align.cpp
 * @author  Ben Gardner
 * @license GPL v2+
 */

#include "align_oc_msg_spec.h"

#include "align_assign.h"
#include "align_stack.h"


void align_oc_msg_spec(size_t span)
{
   LOG_FUNC_ENTRY();

   AlignStack as;

   as.Start(span, 0);

   for (Chunk *pc = Chunk::GetHead(); pc->IsNotNullChunk(); pc = pc->GetNext())
   {
      if (pc->IsNewline())
      {
         as.NewLines(pc->GetNlCount());
      }
      else if (pc->Is(CT_OC_MSG_SPEC))
      {
         as.Add(pc);
      }
   }

   as.End();
} // void align_oc_msg_spec