| 1 | /** |
|---|
| 2 | * SyntaxHighlighter |
|---|
| 3 | * http://alexgorbatchev.com/SyntaxHighlighter |
|---|
| 4 | * |
|---|
| 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. |
|---|
| 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html |
|---|
| 7 | * |
|---|
| 8 | * @version |
|---|
| 9 | * 3.0.83 (July 02 2010) |
|---|
| 10 | * |
|---|
| 11 | * @copyright |
|---|
| 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. |
|---|
| 13 | * |
|---|
| 14 | * @license |
|---|
| 15 | * Dual licensed under the MIT and GPL licenses. |
|---|
| 16 | */ |
|---|
| 17 | ;(function() |
|---|
| 18 | { |
|---|
| 19 | // CommonJS |
|---|
| 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; |
|---|
| 21 | |
|---|
| 22 | function Brush() |
|---|
| 23 | { |
|---|
| 24 | // Copyright 2006 Shin, YoungJin |
|---|
| 25 | |
|---|
| 26 | var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' + |
|---|
| 27 | 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' + |
|---|
| 28 | 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' + |
|---|
| 29 | 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' + |
|---|
| 30 | 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' + |
|---|
| 31 | 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' + |
|---|
| 32 | 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' + |
|---|
| 33 | 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' + |
|---|
| 34 | 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' + |
|---|
| 35 | 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' + |
|---|
| 36 | 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' + |
|---|
| 37 | 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' + |
|---|
| 38 | 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' + |
|---|
| 39 | 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' + |
|---|
| 40 | 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' + |
|---|
| 41 | 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' + |
|---|
| 42 | 'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' + |
|---|
| 43 | 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' + |
|---|
| 44 | 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' + |
|---|
| 45 | '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' + |
|---|
| 46 | 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' + |
|---|
| 47 | 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' + |
|---|
| 48 | 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' + |
|---|
| 49 | 'va_list wchar_t wctrans_t wctype_t wint_t signed'; |
|---|
| 50 | |
|---|
| 51 | var keywords = 'break case catch class const __finally __exception __try ' + |
|---|
| 52 | 'const_cast continue private public protected __declspec ' + |
|---|
| 53 | 'default delete deprecated dllexport dllimport do dynamic_cast ' + |
|---|
| 54 | 'else enum explicit extern if for friend goto inline ' + |
|---|
| 55 | 'mutable naked namespace new noinline noreturn nothrow ' + |
|---|
| 56 | 'register reinterpret_cast return selectany ' + |
|---|
| 57 | 'sizeof static static_cast struct switch template this ' + |
|---|
| 58 | 'thread throw true false try typedef typeid typename union ' + |
|---|
| 59 | 'using uuid virtual void volatile whcar_t while'; |
|---|
| 60 | |
|---|
| 61 | var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' + |
|---|
| 62 | 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' + |
|---|
| 63 | 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' + |
|---|
| 64 | 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' + |
|---|
| 65 | 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' + |
|---|
| 66 | 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' + |
|---|
| 67 | 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' + |
|---|
| 68 | 'fwrite getc getchar gets perror printf putc putchar puts remove ' + |
|---|
| 69 | 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' + |
|---|
| 70 | 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' + |
|---|
| 71 | 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' + |
|---|
| 72 | 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' + |
|---|
| 73 | 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' + |
|---|
| 74 | 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' + |
|---|
| 75 | 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' + |
|---|
| 76 | 'clock ctime difftime gmtime localtime mktime strftime time'; |
|---|
| 77 | |
|---|
| 78 | this.regexList = [ |
|---|
| 79 | { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments |
|---|
| 80 | { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments |
|---|
| 81 | { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings |
|---|
| 82 | { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings |
|---|
| 83 | { regex: /^ *#.*/gm, css: 'preprocessor' }, |
|---|
| 84 | { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' }, |
|---|
| 85 | { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' }, |
|---|
| 86 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' } |
|---|
| 87 | ]; |
|---|
| 88 | }; |
|---|
| 89 | |
|---|
| 90 | Brush.prototype = new SyntaxHighlighter.Highlighter(); |
|---|
| 91 | Brush.aliases = ['cpp', 'c']; |
|---|
| 92 | |
|---|
| 93 | SyntaxHighlighter.brushes.Cpp = Brush; |
|---|
| 94 | |
|---|
| 95 | // CommonJS |
|---|
| 96 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; |
|---|
| 97 | })(); |
|---|