Skip to content

Commit c53d6b7

Browse files
committed
fix:improve error reporting for unexpected tokens by using std::cerr
1 parent 5098cee commit c53d6b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scanner/src/app.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ void App::catchUnkonwnTokens(std::vector<TINY::SCANNER::Token> &tokens) {
129129
hasUnknownTokens = true;
130130
// set color to red
131131
std::cout << "\033[1;31m";
132-
std::cout << "The input contains unexpected tokens, please check the input file."
132+
std::cerr << "The input contains unexpected tokens, please check the input file."
133133
<< std::endl
134134
<< "List of unexpected tokens:"
135135
<< std::endl;
136136
}
137137

138-
std::cout << "-\tError: unexpected token '" << token.getValue()
138+
std::cerr << "-\tError: unexpected token '" << token.getValue()
139139
<< "' at line " << token.getLine()
140140
<< ", column " << token.getColumn()
141141
<< std::endl;

0 commit comments

Comments
 (0)