Update json-schema-to-grammar.cpp

This commit is contained in:
ochafik 2024-05-19 02:29:31 +01:00
parent 431edb8e7b
commit b6b6a6caee

View file

@ -202,13 +202,13 @@ static void _generate_min_max_int(int min_value, int max_value, std::stringstrea
}
auto sub_len = from.length() - i - 1;
if (sub_len > 0) {
out << "(";
auto from_sub = from.substr(i + 1);
auto to_sub = to.substr(i + 1);
auto sub_zeros = repeat("0", sub_len);
auto sub_nines = repeat("9", sub_len);
auto to_reached = false;
out << "(";
if (from_sub == sub_zeros) {
digit_range(from[i], to[i] - 1);
out << " ";