summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/src/flag_decltype.cpp
blob: c5cc013440287b61b36fd682a62ea1e986563906 (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 flag_decltype.cpp
 *
 * @license GPL v2+
 */

#include "chunk_list.h"


bool flag_cpp_decltype(chunk_t *pc)
{
   LOG_FUNC_ENTRY();

   if (chunk_is_token(pc, CT_DECLTYPE))
   {
      auto paren_open = chunk_get_next_ncnnl(pc);

      if (chunk_is_token(paren_open, CT_PAREN_OPEN))
      {
         auto close_paren = chunk_skip_to_match(paren_open);

         if (close_paren != nullptr)
         {
            pc = paren_open;

            do
            {
               chunk_flags_set(pc, PCF_IN_DECLTYPE);
               pc = pc->next;
            } while (pc != close_paren);

            return(true);
         }
      }
   }
   return(false);
} // mark_cpp_decltype