From b6b6a6caeed6cecf36256f1b9d032f370c8e9f44 Mon Sep 17 00:00:00 2001 From: ochafik Date: Sun, 19 May 2024 02:29:31 +0100 Subject: [PATCH] Update json-schema-to-grammar.cpp --- common/json-schema-to-grammar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/json-schema-to-grammar.cpp b/common/json-schema-to-grammar.cpp index d6346913a..b5ead70aa 100644 --- a/common/json-schema-to-grammar.cpp +++ b/common/json-schema-to-grammar.cpp @@ -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 << " ";