From 51d0a29aac53881e4410dcd9f08590b248f2a04a Mon Sep 17 00:00:00 2001 From: Liu Hao Date: Tue, 4 Sep 2018 23:51:50 +0800 Subject: [PATCH 1/3] src/Styles.c: Add more secondary keywords. This adds a number of standard predefined macros for C and C++, as well as the two identifiers with contextual special meanings (that is, `override` and `final`). The duplicated `inline` in the secondary keyword list has been removed because it already exists as a primary keyword. Signed-off-by: Liu Hao --- src/Styles.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Styles.c b/src/Styles.c index 1b5832760..65d2b5977 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -416,11 +416,16 @@ KEYWORDLIST KeyWords_CPP = { "alignof defined naked noreturn", // Secondary keywords "asm __abstract __alignof __asm __assume __based __box __cdecl __declspec __delegate __event " - "__except __except__try __fastcall __finally inline __gc __hook __identifier " + "__except __except__try __fastcall __finally __gc __hook __identifier " "__if_exists __if_not_exists __inline __interface __leave " "__multiple_inheritance __nogc __noop __pin __property __raise " "__sealed __single_inheritance __stdcall __super __try __try_cast __unhook __uuidof __value " - "__virtual_inheritance", + "__virtual_inheritance " + "override final __VA_ARGS__ __has_include " + "__STDC__ __STDC_HOSTED__ __STDC_VERSION__ __cplusplus " + "__STDC_ISO_10646__ __STDC_MB_MIGHT_NEQ_WC__ __STDC_UTF_16__ __STDC_UTF_32__ " + "__STDCPP_DEFAULT_NEW_ALIGNMENT__ __STDCPP_STRICT_POINTER_SAFETY__ __STDCPP_THREADS__ " + "__DATE__ __TIME__ __FILE__ __LINE__", // Documentation comment keywords "", // Global classes and typedefs From 462b6027cf372ce0e74b038c48be3f52d6542a7b Mon Sep 17 00:00:00 2001 From: Liu Hao Date: Tue, 4 Sep 2018 23:56:54 +0800 Subject: [PATCH 2/3] src/Styles.c: Move C99 keywords into primary keyward category. Signed-off-by: Liu Hao --- src/Styles.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Styles.c b/src/Styles.c index 65d2b5977..15f7b8394 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -413,7 +413,8 @@ KEYWORDLIST KeyWords_CPP = { "private protected public register reinterpret_cast restrict return short signed sizeof static " "static_assert static_cast struct switch template this thread_local throw true try typedef typeid typename " "union unsigned using virtual void volatile wchar_t while " - "alignof defined naked noreturn", + "alignof defined naked noreturn " + "_Alignas _Alignof _Atomic _Bool _Complex _Generic _Imaginary _Noreturn _Static_assert _Thread_local", // Secondary keywords "asm __abstract __alignof __asm __assume __based __box __cdecl __declspec __delegate __event " "__except __except__try __fastcall __finally __gc __hook __identifier " @@ -421,7 +422,7 @@ KEYWORDLIST KeyWords_CPP = { "__multiple_inheritance __nogc __noop __pin __property __raise " "__sealed __single_inheritance __stdcall __super __try __try_cast __unhook __uuidof __value " "__virtual_inheritance " - "override final __VA_ARGS__ __has_include " + "override final __VA_ARGS__ __has_include _Pragma " "__STDC__ __STDC_HOSTED__ __STDC_VERSION__ __cplusplus " "__STDC_ISO_10646__ __STDC_MB_MIGHT_NEQ_WC__ __STDC_UTF_16__ __STDC_UTF_32__ " "__STDCPP_DEFAULT_NEW_ALIGNMENT__ __STDCPP_STRICT_POINTER_SAFETY__ __STDCPP_THREADS__ " @@ -431,8 +432,7 @@ KEYWORDLIST KeyWords_CPP = { // Global classes and typedefs "complex imaginary int8_t int16_t int32_t int64_t intptr_t intmax_t ptrdiff_t size_t " "uint8_t uint16_t uint32_t uint64_t uintptr_t uintmax_t " - "__int16 __int32 __int64 __int8 __m128 __m128d __m128i __m64 __wchar_t " - "_Alignas _Alignof _Atomic _Bool _Complex _Generic _Imaginary _Noreturn _Pragma _Static_assert _Thread_local", + "__int16 __int32 __int64 __int8 __m128 __m128d __m128i __m64 __wchar_t ", // Preprocessor definitions "DEBUG NDEBUG UNICODE _DEBUG _UNICODE _MSC_VER", // Task marker and error marker keywords From ae059e0723d27711d496aa1803c78f7829fee6ea Mon Sep 17 00:00:00 2001 From: Liu Hao Date: Wed, 5 Sep 2018 00:04:41 +0800 Subject: [PATCH 3/3] src/Styles.c: Add __VA_OPT__ for C++2a. Signed-off-by: Liu Hao --- src/Styles.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Styles.c b/src/Styles.c index 15f7b8394..93dd31368 100644 --- a/src/Styles.c +++ b/src/Styles.c @@ -422,7 +422,7 @@ KEYWORDLIST KeyWords_CPP = { "__multiple_inheritance __nogc __noop __pin __property __raise " "__sealed __single_inheritance __stdcall __super __try __try_cast __unhook __uuidof __value " "__virtual_inheritance " - "override final __VA_ARGS__ __has_include _Pragma " + "override final __VA_ARGS__ __VA_OPT__ __has_include _Pragma " "__STDC__ __STDC_HOSTED__ __STDC_VERSION__ __cplusplus " "__STDC_ISO_10646__ __STDC_MB_MIGHT_NEQ_WC__ __STDC_UTF_16__ __STDC_UTF_32__ " "__STDCPP_DEFAULT_NEW_ALIGNMENT__ __STDCPP_STRICT_POINTER_SAFETY__ __STDCPP_THREADS__ "