summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/src/align_asm_colon.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-12-20 23:01:54 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-12-22 11:50:09 +0900
commit112ca8677b9b024de5529712e559c968da40a67a (patch)
treea8e93a0b05d61aeaab1dab3288c5fc518cdd05c6 /debian/uncrustify-trinity/uncrustify-trinity-0.72.0/src/align_asm_colon.cpp
parentb37f44d6c7444ca20c48a07fdcaf7b2a812db5bd (diff)
downloadextra-dependencies-112ca8677b9b024de5529712e559c968da40a67a.tar.gz
extra-dependencies-112ca8677b9b024de5529712e559c968da40a67a.zip
DEB uncrustify: added first version of uncrustify-trinity. This is basically the upstream 0.72.0 version of uncrustify, repackaged.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.72.0/src/align_asm_colon.cpp')
-rw-r--r--debian/uncrustify-trinity/uncrustify-trinity-0.72.0/src/align_asm_colon.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/src/align_asm_colon.cpp b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/src/align_asm_colon.cpp
new file mode 100644
index 00000000..2f749b5c
--- /dev/null
+++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/src/align_asm_colon.cpp
@@ -0,0 +1,62 @@
+/**
+ * @file align_asm_colon.cpp
+ *
+ * @author Guy Maurel
+ * split from align.cpp
+ * @author Ben Gardner
+ * @license GPL v2+
+ */
+
+#include "align_asm_colon.h"
+
+#include "align_stack.h"
+#include "chunk_list.h"
+
+
+void align_asm_colon(void)
+{
+ LOG_FUNC_ENTRY();
+
+ bool did_nl;
+ AlignStack cas; // for the colons
+
+ cas.Start(4);
+
+ chunk_t *pc = chunk_get_head();
+
+ while (pc != nullptr)
+ {
+ if (chunk_is_not_token(pc, CT_ASM_COLON))
+ {
+ pc = chunk_get_next(pc);
+ continue;
+ }
+ cas.Reset();
+
+ pc = chunk_get_next_ncnl(pc, scope_e::PREPROC);
+ size_t level = pc ? pc->level : 0;
+ did_nl = true;
+
+ while ( pc != nullptr
+ && pc->level >= level)
+ {
+ if (chunk_is_newline(pc))
+ {
+ cas.NewLines(pc->nl_count);
+ did_nl = true;
+ }
+ else if (chunk_is_token(pc, CT_ASM_COLON))
+ {
+ cas.Flush();
+ did_nl = true;
+ }
+ else if (did_nl)
+ {
+ did_nl = false;
+ cas.Add(pc);
+ }
+ pc = chunk_get_next_nc(pc, scope_e::PREPROC);
+ }
+ cas.End();
+ }
+} // align_asm_colon