bump simplecpp

This commit is contained in:
Daniel Marjamäki 2018-10-09 21:17:38 +02:00
parent 053b0d1654
commit f6f4116389
2 changed files with 5 additions and 3 deletions

View File

@ -1089,7 +1089,7 @@ std::string simplecpp::TokenList::lastLine(int maxsize) const
if (!ret.empty()) if (!ret.empty())
ret = ' ' + ret; ret = ' ' + ret;
ret = (tok->str()[0] == '\"' ? std::string("%str%") ret = (tok->str()[0] == '\"' ? std::string("%str%")
: std::isdigit(static_cast<unsigned char>(tok->str()[0])) ? std::string("%num%") : tok->str()) + ret; : tok->number ? std::string("%num%") : tok->str()) + ret;
if (++count > maxsize) if (++count > maxsize)
return ""; return "";
} }

View File

@ -113,7 +113,9 @@ namespace simplecpp {
op = (string.size() == 1U) ? string[0] : '\0'; op = (string.size() == 1U) ? string[0] : '\0';
} }
const TokenString& str() const { return string; } const TokenString& str() const {
return string;
}
void setstr(const std::string &s) { void setstr(const std::string &s) {
string = s; string = s;
flags(); flags();
@ -258,7 +260,7 @@ namespace simplecpp {
std::string readUntil(std::istream &istr, const Location &location, const char start, const char end, OutputList *outputList); std::string readUntil(std::istream &istr, const Location &location, const char start, const char end, OutputList *outputList);
std::string lastLine(int maxsize=10) const; std::string lastLine(int maxsize=100000) const;
unsigned int fileIndex(const std::string &filename); unsigned int fileIndex(const std::string &filename);