summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/src/cs_top_is_question.cpp
blob: d358912c7ffa7b4acee5da660cb31261e0a6c073 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
 * @file cs_top_is_question.cpp
 *
 * @author  Guy Maurel
 * @license GPL v2+
 * extract from combine.cpp
 */

#include "cs_top_is_question.h"

#include "chunk_list.h"


bool cs_top_is_question(ChunkStack &cs, size_t level)
{
   chunk_t *pc = cs.Empty() ? nullptr : cs.Top()->m_pc;

   return(  chunk_is_token(pc, CT_QUESTION)
         && pc->level == level);
}