Skip to content

Commit 6c6cbdd

Browse files
committed
adjusted some catch handlers
1 parent 25bc0de commit 6c6cbdd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

simplecpp.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <cstdlib>
3434
#include <cstring>
3535
#include <ctime>
36-
#include <exception>
3736
#include <fstream>
3837
#include <iostream>
3938
#include <istream>
@@ -490,7 +489,7 @@ simplecpp::TokenList::TokenList(const std::string &filename, std::vector<std::st
490489
try {
491490
FileStream stream(filename, filenames);
492491
readfile(stream,filename,outputList);
493-
} catch (const simplecpp::Output & e) { // TODO handle extra type of errors
492+
} catch (const simplecpp::Output & e) {
494493
outputList->push_back(e);
495494
}
496495
}
@@ -3691,7 +3690,7 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
36913690
const long long result = evaluate(expr, dui, sizeOfType);
36923691
conditionIsTrue = (result != 0);
36933692
}
3694-
} catch (const std::exception &e) {
3693+
} catch (const std::runtime_error &e) {
36953694
if (outputList) {
36963695
std::string msg = "failed to evaluate " + std::string(rawtok->str() == IF ? "#if" : "#elif") + " condition";
36973696
if (e.what() && *e.what())

0 commit comments

Comments
 (0)