pivariant, enum, tiny format

This commit is contained in:
2022-12-13 21:44:06 +03:00
parent 9d9357b0ca
commit c74ba871cd
15 changed files with 1914 additions and 851 deletions

View File

@@ -1391,6 +1391,31 @@ PIString PIString::takeNumber() {
}
PIString PIString::takeInteger() {
PIString ret;
int sz = size_s(), ws = -1, we = -1;
for (int i = 0; i < sz; ++i) {
PIChar c = at(i);
if (c == ' ' || c == '\t' || c == '\n' || c == '\r') {
if (we < 0 && ws >= 0) {
we = i;
break;
}
} else {
if (ws < 0) ws = i;
if (!c.isDigit()) {
we = i;
break;
}
if (we >= 0) break;
}
}
ret = mid(ws, we - ws);
cutLeft(we < 0 ? sz : we);
return ret;
}
//! \~\details
//! \~english "shield" symbol prevent analysis of the next symbol
//! \~russian Символ "shield" экранирует следующий символ