bump simplecpp

This commit is contained in:
Daniel Marjamäki 2018-02-11 15:48:37 +01:00
parent d68f07e50c
commit bf76183eea
1 changed files with 21 additions and 0 deletions

View File

@ -466,6 +466,16 @@ void simplecpp::TokenList::readfile(std::istream &istr, const std::string &filen
TokenString currentToken;
if (cback() && cback()->previous && cback()->previous->op == '#' && (lastLine() == "# error" || lastLine() == "# warning")) {
while (istr.good() && ch != '\r' && ch != '\n') {
currentToken += ch;
ch = readChar(istr, bom);
}
istr.unget();
push_back(new Token(currentToken, location));
continue;
}
// number or name
if (isNameChar(ch)) {
const bool num = std::isdigit(ch);
@ -2313,6 +2323,17 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
inc2.takeTokens(inc1);
}
if (!inc2.empty() && inc2.cfront()->op == '<' && inc2.cback()->op == '>') {
TokenString hdr;
// TODO: Sometimes spaces must be added in the string
// Somehow preprocessToken etc must be told that the location should be source location not destination location
for (const Token *tok = inc2.cfront(); tok; tok = tok->next) {
hdr += tok->str;
}
inc2.clear();
inc2.push_back(new Token(hdr, inc1.cfront()->location));
}
if (inc2.empty() || inc2.cfront()->str.size() <= 2U) {
if (outputList) {
simplecpp::Output err(files);