More work on better parser logging.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
20
extern/format.hpp
vendored
20
extern/format.hpp
vendored
@@ -41,9 +41,12 @@ namespace util {
|
||||
|
||||
char* endptr = nullptr;
|
||||
index = strtol(&item[0], &endptr, 10);
|
||||
if (index < 0 || index >= (int)args.size()) {
|
||||
if (index >= (int)args.size()) {
|
||||
return;
|
||||
}
|
||||
if (index < 0) {
|
||||
index = args.size() + index;
|
||||
}
|
||||
|
||||
if (*endptr == ',') {
|
||||
alignment = strtol(endptr + 1, &endptr, 10);
|
||||
@@ -57,8 +60,21 @@ namespace util {
|
||||
if (*endptr == ':') {
|
||||
fmt = endptr + 1;
|
||||
}
|
||||
if (*endptr == '.' && *(endptr + 1) == '.') {
|
||||
auto endIndex = strtol(endptr + 2, &endptr, 10);
|
||||
if (endIndex < 0) {
|
||||
endIndex = args.size() + endIndex + 1;
|
||||
}
|
||||
|
||||
args[index]->Format(ss, fmt);
|
||||
for (; index < endIndex; index++) {
|
||||
args[index]->Format(ss, fmt);
|
||||
if (index != endIndex - 1) {
|
||||
ss << ", ";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
args[index]->Format(ss, fmt);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user