diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-11-18 17:53:35 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-11-19 19:27:29 +0900 |
commit | c0a6f1b84c84749908961579b84513fd9f9d9eac (patch) | |
tree | ace7ba60cb031acd3a1f4ff10f7bbc5668fa801f /debian/uncrustify-trinity/uncrustify-trinity-0.78.0/src/align_asm_colon.cpp | |
parent | 52e5ffe140f0f4402e97936447bc9a606045d2b5 (diff) | |
download | extra-dependencies-c0a6f1b84c84749908961579b84513fd9f9d9eac.tar.gz extra-dependencies-c0a6f1b84c84749908961579b84513fd9f9d9eac.zip |
uncrustify-trinity: updated based on upstream version 0.78.0
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.78.0/src/align_asm_colon.cpp')
-rw-r--r-- | debian/uncrustify-trinity/uncrustify-trinity-0.78.0/src/align_asm_colon.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/src/align_asm_colon.cpp b/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/src/align_asm_colon.cpp new file mode 100644 index 00000000..4eaca4f3 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.78.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.h" + + +void align_asm_colon() +{ + LOG_FUNC_ENTRY(); + + bool did_nl; + AlignStack cas; // for the colons + + cas.Start(4); + + Chunk *pc = Chunk::GetHead(); + + while (pc->IsNotNullChunk()) + { + if (pc->IsNot(CT_ASM_COLON)) + { + pc = pc->GetNext(); + continue; + } + cas.Reset(); + + pc = pc->GetNextNcNnl(E_Scope::PREPROC); + size_t level = pc->IsNotNullChunk() ? pc->GetLevel() : 0; + did_nl = true; + + while ( pc->IsNotNullChunk() + && pc->GetLevel() >= level) + { + if (pc->IsNewline()) + { + cas.NewLines(pc->GetNlCount()); + did_nl = true; + } + else if (pc->Is(CT_ASM_COLON)) + { + cas.Flush(); + did_nl = true; + } + else if (did_nl) + { + did_nl = false; + cas.Add(pc); + } + pc = pc->GetNextNc(E_Scope::PREPROC); + } + cas.End(); + } +} // align_asm_colon |