Skip to content

Commit

Permalink
style: use clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
star0202 committed May 24, 2024
1 parent 962da79 commit 11560ea
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
14 changes: 14 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
BasedOnStyle: Google
AlignAfterOpenBracket: BlockIndent
AlignConsecutiveMacros:
Enabled: true
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
BinPackArguments: false
BinPackParameters: false
IndentWidth: 4
InsertNewlineAtEOF: true
PackConstructorInitializers: CurrentLine
SpaceBeforeCpp11BracedList: true
41 changes: 22 additions & 19 deletions tools/debugger/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ using namespace std;
_print_value(_it, __VA_ARGS__); \
}

#define ESC (string) "\033["
#define RESET ESC + "0m"
#define BOLD ESC + "1m"
#define RED ESC + "31m"
#define CYAN ESC + "36m"
#define YELLOW ESC + "33m"
#define ESC (string) "\033["
#define RESET ESC + "0m"
#define BOLD ESC + "1m"
#define RED ESC + "31m"
#define CYAN ESC + "36m"
#define YELLOW ESC + "33m"
#define BR_MAGENTA ESC + "95m"
#define BR_GREEN ESC + "92m"
#define BLUE ESC + "34m"
#define GRAY ESC + "90m"
#define BR_GREEN ESC + "92m"
#define BLUE ESC + "34m"
#define GRAY ESC + "90m"

#define HEADER BOLD + YELLOW
#define ERROR BOLD + RED
#define ERROR BOLD + RED

#define DEFAULT BR_MAGENTA
#define STRING BR_GREEN
#define BOOL BR_GREEN
#define DEFAULT BR_MAGENTA
#define STRING BR_GREEN
#define BOOL BR_GREEN
#define CONTAINER BLUE
#define SEP GRAY
#define OPERATOR BOLD + CYAN
#define INDENT " "
#define SEP GRAY
#define OPERATOR BOLD + CYAN
#define INDENT " "

namespace filter {

Expand Down Expand Up @@ -134,7 +134,8 @@ typename enable_if<filter::is_map<T>::value, string>::type to_string(T m) {

template <class T>
typename enable_if<filter::is_supports_top<T>::value, string>::type to_string(
T v) {
T v
) {
T t = v;
bool first = true;
string res = CONTAINER + "{ ";
Expand Down Expand Up @@ -178,14 +179,16 @@ string to_string(tuple<T...> t) {
first = false),
...);
},
t);
t
);
res += CONTAINER + " }" + RESET;
return res;
}

template <class T>
typename enable_if<!filter::is_implemented<T>::value, string>::type to_string(
T) {
T x
) {
return ERROR + "Not implemented" + RESET;
}

Expand Down

0 comments on commit 11560ea

Please sign in to comment.