c-family: Regroup C++ keywords and consider C++20
This commit is contained in:
parent
0e859f54da
commit
059b086e62
|
@ -247,29 +247,31 @@ add-highlighter shared/cpp/code/char regex %{(\b(u8|u|U|L)|\B)'((\\.)|[^'\\])'\B
|
||||||
evaluate-commands %sh{
|
evaluate-commands %sh{
|
||||||
# Grammar
|
# Grammar
|
||||||
keywords="alignas alignof and and_eq asm bitand bitor break case catch
|
keywords="alignas alignof and and_eq asm bitand bitor break case catch
|
||||||
compl const_cast continue decltype default delete do dynamic_cast
|
compl const_cast continue decltype delete do dynamic_cast
|
||||||
else explicit for goto if new not not_eq operator or or_eq
|
else export for goto if new not not_eq operator or or_eq
|
||||||
reinterpret_cast return sizeof static_assert static_cast switch
|
reinterpret_cast return sizeof static_assert static_cast switch
|
||||||
throw try typeid using while xor xor_eq"
|
throw try typedef typeid using while xor xor_eq"
|
||||||
attributes="auto class const constexpr enum extern final friend inline
|
attributes="audit auto axiom const consteval constexpr default explicit
|
||||||
mutable namespace noexcept override private protected public
|
extern final friend inline mutable noexcept override private
|
||||||
register static struct template thread_local typedef typename
|
protected public register requires static thread_local typename
|
||||||
union virtual volatile"
|
virtual volatile"
|
||||||
types="bool byte char char16_t char32_t double float int long max_align_t
|
entities="class concept enum namespace struct template union"
|
||||||
nullptr_t ptrdiff_t short signed size_t unsigned void wchar_t"
|
types="bool byte char char8_t char16_t char32_t double float int long
|
||||||
|
max_align_t nullptr_t ptrdiff_t short signed size_t unsigned void
|
||||||
|
wchar_t"
|
||||||
values="NULL false nullptr this true"
|
values="NULL false nullptr this true"
|
||||||
|
|
||||||
join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; }
|
join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; }
|
||||||
|
|
||||||
# Add the language's grammar to the static completion list
|
# Add the language's grammar to the static completion list
|
||||||
printf %s\\n "hook global WinSetOption filetype=cpp %{
|
printf %s\\n "hook global WinSetOption filetype=cpp %{
|
||||||
set-option window static_words $(join "${keywords} ${attributes} ${types} ${values}" ' ')
|
set-option window static_words $(join "${keywords} ${attributes} ${entities} ${types} ${values}" ' ')
|
||||||
}"
|
}"
|
||||||
|
|
||||||
# Highlight keywords
|
# Highlight keywords
|
||||||
printf %s "
|
printf %s "
|
||||||
add-highlighter shared/cpp/code/keywords regex \b($(join "${keywords}" '|'))\b 0:keyword
|
add-highlighter shared/cpp/code/keywords regex \b($(join "${keywords}" '|'))\b 0:keyword
|
||||||
add-highlighter shared/cpp/code/attributes regex \b($(join "${attributes}" '|'))\b 0:attribute
|
add-highlighter shared/cpp/code/attributes regex \b($(join "${attributes} ${entities}" '|'))\b 0:attribute
|
||||||
add-highlighter shared/cpp/code/types regex \b($(join "${types}" '|'))\b 0:type
|
add-highlighter shared/cpp/code/types regex \b($(join "${types}" '|'))\b 0:type
|
||||||
add-highlighter shared/cpp/code/values regex \b($(join "${values}" '|'))\b 0:value
|
add-highlighter shared/cpp/code/values regex \b($(join "${values}" '|'))\b 0:value
|
||||||
"
|
"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user