From 192fc808c8da3b81d1f8f4ba2cbbd477236c0976 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Mon, 27 Jan 2025 19:06:27 -0500 Subject: [PATCH] Run clang-format on some Bison .y file contents --- src/asm/parser.y | 23 ++++++++++------------- src/link/script.y | 7 +++++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/asm/parser.y b/src/asm/parser.y index 208767d8..419945fa 100644 --- a/src/asm/parser.y +++ b/src/asm/parser.y @@ -9,14 +9,14 @@ #include #include + #include "either.hpp" + #include "linkdefs.hpp" + #include "asm/lexer.hpp" #include "asm/macro.hpp" #include "asm/rpn.hpp" #include "asm/section.hpp" - #include "either.hpp" - #include "linkdefs.hpp" - struct AlignmentSpec { uint8_t alignment; uint16_t alignOfs; @@ -42,6 +42,7 @@ StrFmtArgList &operator=(StrFmtArgList &&) = default; }; } + %code { #include #include @@ -51,6 +52,9 @@ #include #include + #include "extern/utf8decoder.hpp" + #include "helpers.hpp" + #include "asm/charmap.hpp" #include "asm/fixpoint.hpp" #include "asm/format.hpp" @@ -62,10 +66,6 @@ #include "asm/symbol.hpp" #include "asm/warning.hpp" - #include "extern/utf8decoder.hpp" - - #include "helpers.hpp" - using namespace std::literals; yy::parser::symbol_type yylex(); // Provided by lexer.cpp @@ -77,9 +77,7 @@ static size_t charlenUTF8(std::string const &str); static std::string charsubUTF8(std::string const &str, uint32_t pos); static uint32_t adjustNegativePos(int32_t pos, size_t len, char const *functionName); - static std::string strrpl( - std::string_view str, std::string const &old, std::string const &rep - ); + static std::string strrpl(std::string_view str, std::string const &old, std::string const &rep); static std::string strfmt( std::string const &spec, std::vector> const &args ); @@ -2650,9 +2648,8 @@ static std::string strrpl(std::string_view str, std::string const &old, std::str return rpl; } -static std::string strfmt( - std::string const &spec, std::vector> const &args -) { +static std::string + strfmt(std::string const &spec, std::vector> const &args) { std::string str; size_t argIndex = 0; diff --git a/src/link/script.y b/src/link/script.y index 9feae1f8..a33ccf3c 100644 --- a/src/link/script.y +++ b/src/link/script.y @@ -12,6 +12,7 @@ void script_ProcessScript(char const *path); } + %code { #include #include @@ -394,7 +395,8 @@ static void setActiveTypeAndIdx(SectionType type, uint32_t idx) { static void setFloatingSectionType(SectionType type) { if (nbbanks(type) == 1) { - setActiveTypeAndIdx(type, 0); // There is only a single bank anyway, so just set the index to 0. + // There is only a single bank anyway, so just set the index to 0. + setActiveTypeAndIdx(type, 0); } else { activeType = type; activeBankIdx = UINT32_MAX; @@ -634,7 +636,8 @@ static void placeSection(std::string const &name, bool isOptional) { typeInfo.name.c_str() ); } else { - // SDCC areas don't have a type assigned yet, so the linker script is used to give them one. + // SDCC areas don't have a type assigned yet, so the linker script is used to give them + // one. for (Section *fragment = section; fragment; fragment = fragment->nextu.get()) { fragment->type = activeType; }