From 81e450f3eba5c3e9112a249ae85b696371d738f9 Mon Sep 17 00:00:00 2001 From: Lavan JV <70334120+jvlavan@users.noreply.github.com> Date: Thu, 3 Oct 2024 03:28:16 +0530 Subject: [PATCH] enh(cpp) add flat_map and flat_set c++23 new features (#4127) --- CHANGES.md | 4 +++- src/languages/cpp.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 660d950582..cae070ee15 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -21,7 +21,8 @@ Core Grammars: - fix(typescript) - Fixedoptional property not highlighted correctly [Dxuian] - fix(ruby) - fix `|=` operator false positives (as block arguments) [Aboobacker MK] - fix(sql) - Fixed sql primary key and foreign key spacing issue [Dxuian] - +- fix(cpp) added flat_set and flat_map as a part of cpp 23 version [Lavan] + New Grammars: - added 3rd party TTCN-3 grammar to SUPPORTED_LANGUAGES [Osmocom][] @@ -53,6 +54,7 @@ CONTRIBUTORS [Sainan]: https://github.com/Sainan [Osmocom]: https://github.com/osmocom [Álvaro Mondéjar]: https://github.com/mondeja +[Lavan]: https://github.com/jvlavan ## Version 11.10.0 diff --git a/src/languages/cpp.js b/src/languages/cpp.js index 64aee1d44e..e2f944800a 100644 --- a/src/languages/cpp.js +++ b/src/languages/cpp.js @@ -247,6 +247,8 @@ export default function(hljs) { 'counting_semaphore', 'deque', 'false_type', + 'flat_map', + 'flat_set', 'future', 'imaginary', 'initializer_list', @@ -572,7 +574,7 @@ export default function(hljs) { [ PREPROCESSOR, { // containers: ie, `vector rooms (9);` - begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)', + begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)', end: '>', keywords: CPP_KEYWORDS, contains: [