Skip to content

Commit f87f812

Browse files
authored
Merge pull request #2 from wevsty/master
Add more cpp and python grammar keywords
2 parents 16e4266 + 2fac673 commit f87f812

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

syntaxhighlighter3/scripts/shBrushCpp.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' +
4040
'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' +
4141
'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' +
42-
'char char16_t char32_t bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' +
42+
'char char8_t char16_t char32_t bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' +
4343
'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' +
4444
'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' +
4545
'__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' +
@@ -49,14 +49,14 @@
4949
'va_list wchar_t wctrans_t wctype_t wint_t signed';
5050

5151
var keywords = 'alignas alignof auto break case catch class const constexpr decltype __finally __exception __try ' +
52-
'const_cast continue private public protected __declspec ' +
52+
'const_cast consteval concept continue private public protected __declspec ' +
5353
'default delete deprecated dllexport dllimport do dynamic_cast ' +
54-
'else enum explicit extern if for friend goto inline ' +
54+
'else enum explicit extern if for friend final goto inline ' +
5555
'mutable naked namespace new noinline noreturn nothrow noexcept nullptr ' +
56-
'ref register reinterpret_cast return selectany ' +
56+
'override ref register reinterpret_cast requires return selectany ' +
5757
'sizeof static static_cast static_assert struct switch template this ' +
5858
'thread thread_local throw true false try typedef typeid typename union ' +
59-
'using uuid virtual void volatile whcar_t while';
59+
'using uuid virtual void volatile whcar_t while xor xor_eq ';
6060

6161
var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' +
6262
'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' +
@@ -78,6 +78,8 @@
7878
this.regexList = [
7979
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
8080
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
81+
{ regex: /(R|L|U|u|u8)?"([^\\"\n]|\\.)*"/g, css: 'string' }, // special character
82+
{ regex: /(R|L|U|u|u8)?'([^\\'\n]|\\.)*'/g, css: 'string' }, // special string
8183
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
8284
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
8385
{ regex: /^ *#.*/gm, css: 'preprocessor' },

syntaxhighlighter3/scripts/shBrushPython.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{
2424
// Contributed by Gheorghe Milas and Ahmad Sherif
2525

26-
var keywords = 'and assert break class continue def del elif else ' +
26+
var keywords = 'and assert async await break class continue def del elif else ' +
2727
'except exec finally for from global if import in is ' +
2828
'lambda not or pass raise return try yield while';
2929

0 commit comments

Comments
 (0)