Minor formatting changes to suit current preferences
This commit is contained in:
parent
6db8b386af
commit
b0209ad609
1 changed files with 17 additions and 16 deletions
27
src/main.cpp
27
src/main.cpp
|
|
@ -149,15 +149,15 @@ void printWarnErr(std::vector<TabSpaceCount> counts) {
|
|||
if(lastTag != token.tag) {
|
||||
lastTag = token.tag;
|
||||
switch(lastTag) {
|
||||
case NONE:
|
||||
case NONE: {
|
||||
printf("\e[0m");
|
||||
break;
|
||||
case WARNING:
|
||||
} break;
|
||||
case WARNING: {
|
||||
printf("\e[33;1m");
|
||||
break;
|
||||
case ERROR:
|
||||
} break;
|
||||
case ERROR: {
|
||||
printf("\e[31;1m");
|
||||
break;
|
||||
}break;
|
||||
}
|
||||
}
|
||||
if(token.type == TAB) {
|
||||
|
|
@ -179,7 +179,8 @@ bool checkTrailingWhitespace(TabSpaceCount& count) {
|
|||
count.tokens[i].tag = ERROR;
|
||||
ret = true;
|
||||
}
|
||||
else if (count.tokens[i].type == NEWLINE) {}
|
||||
else if (count.tokens[i].type == NEWLINE)
|
||||
{}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
|
|
@ -213,18 +214,18 @@ int main(int argc, char** argv)
|
|||
TabSpaceCount lastCount = {};
|
||||
for(Token token : tokens) {
|
||||
switch(token.type) {
|
||||
case TAB:
|
||||
case TAB: {
|
||||
if(recording) lastCount.tabs += 1;
|
||||
lastCount.tokens.push_back(token);
|
||||
break;
|
||||
case SPACE:
|
||||
} break;
|
||||
case SPACE: {
|
||||
if(recording) lastCount.spaces += 1;
|
||||
lastCount.tokens.push_back(token);
|
||||
break;
|
||||
case UNKNOWN:
|
||||
} break;
|
||||
case UNKNOWN: {
|
||||
recording = false;
|
||||
lastCount.tokens.push_back(token);
|
||||
break;
|
||||
} break;
|
||||
case NEWLINE: {
|
||||
lastCount.tokens.push_back(token);
|
||||
counts.push_back(lastCount);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue