diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2023-12-14 07:54:29 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2023-12-14 08:21:54 +0300 |
commit | db7f91de8c86629d479db1daf8dddf9704186478 (patch) | |
tree | d0175a4e634ef25468fa1b78c8ef71c56f074e53 /contrib/restricted/nlohmann_json/include/nlohmann/detail/input/parser.hpp | |
parent | e938f3027e06f8f4f3f2f0d79d0262d91caac192 (diff) | |
download | ydb-db7f91de8c86629d479db1daf8dddf9704186478.tar.gz |
Update contrib/restricted/nlohmann_json to 3.11.3
Diffstat (limited to 'contrib/restricted/nlohmann_json/include/nlohmann/detail/input/parser.hpp')
-rw-r--r-- | contrib/restricted/nlohmann_json/include/nlohmann/detail/input/parser.hpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/contrib/restricted/nlohmann_json/include/nlohmann/detail/input/parser.hpp b/contrib/restricted/nlohmann_json/include/nlohmann/detail/input/parser.hpp index 8acbd4fcad..bdf85ba292 100644 --- a/contrib/restricted/nlohmann_json/include/nlohmann/detail/input/parser.hpp +++ b/contrib/restricted/nlohmann_json/include/nlohmann/detail/input/parser.hpp @@ -1,9 +1,9 @@ // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ -// | | |__ | | | | | | version 3.11.2 +// | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // -// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me> +// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> // SPDX-License-Identifier: MIT #pragma once @@ -341,13 +341,25 @@ class parser m_lexer.get_token_string(), parse_error::create(101, m_lexer.get_position(), exception_message(token_type::uninitialized, "value"), nullptr)); } + case token_type::end_of_input: + { + if (JSON_HEDLEY_UNLIKELY(m_lexer.get_position().chars_read_total == 1)) + { + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), + "attempting to parse an empty input; check that your input string or stream contains the expected JSON", nullptr)); + } + return sax->parse_error(m_lexer.get_position(), + m_lexer.get_token_string(), + parse_error::create(101, m_lexer.get_position(), exception_message(token_type::literal_or_value, "value"), nullptr)); + } case token_type::uninitialized: case token_type::end_array: case token_type::end_object: case token_type::name_separator: case token_type::value_separator: - case token_type::end_of_input: case token_type::literal_or_value: default: // the last token was unexpected { |