Skip to content

Commit 29e338b

Browse files
dmaclachmarijnh
authored andcommitted
[clike] Update C++ keywords to C++20
1 parent ea298af commit 29e338b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

mode/clike/clike.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -420,16 +420,18 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
420420

421421
def(["text/x-c++src", "text/x-c++hdr"], {
422422
name: "clike",
423-
keywords: words(cKeywords + " dynamic_cast namespace reinterpret_cast try explicit new " +
424-
"static_cast typeid catch operator template typename class friend private " +
425-
"this using const_cast public throw virtual delete mutable protected " +
426-
"alignas alignof constexpr decltype nullptr noexcept thread_local final " +
427-
"static_assert override"),
423+
// Keywords from https://en.cppreference.com/w/cpp/keyword includes C++20.
424+
keywords: words(cKeywords + "alignas alignof and and_eq audit axiom bitand bitor catch " +
425+
"class compl concept constexpr const_cast decltype delete dynamic_cast " +
426+
"explicit export final friend import module mutable namespace new noexcept " +
427+
"not not_eq operator or or_eq override private protected public " +
428+
"reinterpret_cast requires static_assert static_cast template this " +
429+
"thread_local throw try typeid typename using virtual xor xor_eq"),
428430
types: cTypes,
429-
blockKeywords: words(cBlockKeywords +" class try catch finally"),
431+
blockKeywords: words(cBlockKeywords + " class try catch"),
430432
defKeywords: words(cDefKeywords + " class namespace"),
431433
typeFirstDefinitions: true,
432-
atoms: words("true false NULL"),
434+
atoms: words("true false NULL nullptr"),
433435
dontIndentStatements: /^template$/,
434436
isIdentifierChar: /[\w\$_~\xa1-\uffff]/,
435437
isReservedIdentifier: cIsReservedIdentifier,

0 commit comments

Comments
 (0)