From 8de151f928720a4eee2959780249851082a419cf Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Fri, 2 Oct 2026 19:08:41 +0200 Subject: [PATCH] Fix CI: no backslash sequence in the lexer's doc comments clang's -Wdocumentation-unknown-command reads "\u" in a doc comment as an unknown command, even in backticks. Two comments of the recovery code now say "Unicode escape" instead. Signed-off-by: Niels Lohmann --- include/nlohmann/detail/input/lexer.hpp | 4 ++-- single_include/nlohmann/json.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/nlohmann/detail/input/lexer.hpp b/include/nlohmann/detail/input/lexer.hpp index bd84802ef..a4935d15e 100644 --- a/include/nlohmann/detail/input/lexer.hpp +++ b/include/nlohmann/detail/input/lexer.hpp @@ -2121,7 +2121,7 @@ scan_number_done: read of the token and skips the rest: - A string keeps its characters. An unknown escape stands for the escaped - character itself (as in JavaScript), an invalid `\u` escape and ill-formed + character itself (as in JavaScript), an invalid Unicode escape and ill-formed UTF-8 become U+FFFD, and a control character is kept. A line break or the end of the input ends a string that lacks its closing quote. - A number keeps its longest valid prefix, e.g. `1` for `1.` or `1e+`. @@ -2298,7 +2298,7 @@ scan_number_done: } } - /// append a code point read from a `\u` escape; a surrogate becomes U+FFFD + /// append a code point read from a Unicode escape; a surrogate becomes U+FFFD void add_escaped_codepoint(const int codepoint) { if (0xD800 <= codepoint && codepoint <= 0xDFFF) diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 4731d6f7a..04b10fbcd 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -12259,7 +12259,7 @@ scan_number_done: read of the token and skips the rest: - A string keeps its characters. An unknown escape stands for the escaped - character itself (as in JavaScript), an invalid `\u` escape and ill-formed + character itself (as in JavaScript), an invalid Unicode escape and ill-formed UTF-8 become U+FFFD, and a control character is kept. A line break or the end of the input ends a string that lacks its closing quote. - A number keeps its longest valid prefix, e.g. `1` for `1.` or `1e+`. @@ -12436,7 +12436,7 @@ scan_number_done: } } - /// append a code point read from a `\u` escape; a surrogate becomes U+FFFD + /// append a code point read from a Unicode escape; a surrogate becomes U+FFFD void add_escaped_codepoint(const int codepoint) { if (0xD800 <= codepoint && codepoint <= 0xDFFF)