diff options
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.74.0/src/flag_decltype.cpp')
-rw-r--r-- | debian/uncrustify-trinity/uncrustify-trinity-0.74.0/src/flag_decltype.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/src/flag_decltype.cpp b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/src/flag_decltype.cpp new file mode 100644 index 00000000..c5cc0134 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/src/flag_decltype.cpp @@ -0,0 +1,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 |