0

Update to 8.0

This commit is contained in:
Rogaboru Kujimoshi
2014-06-08 21:04:39 +04:00
parent 81d0115677
commit a52831ccdb
134 changed files with 10392 additions and 4999 deletions

View File

@@ -1,9 +1,10 @@
/*
Language: C++
Contributors: Evgeny Stepanischev <imbolk@gmail.com>
Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
Contributors: Evgeny Stepanischev <imbolk@gmail.com>, Zaven Muradyan <megalivoithos@gmail.com>
*/
hljs.LANGUAGES['cpp'] = function(hljs) {
function(hljs) {
var CPP_KEYWORDS = {
keyword: 'false int float while private char catch export virtual operator sizeof ' +
'dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace ' +
@@ -11,41 +12,57 @@ hljs.LANGUAGES['cpp'] = function(hljs) {
'do return goto auto void enum else break new extern using true class asm case typeid ' +
'short reinterpret_cast|10 default double register explicit signed typename try this ' +
'switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype ' +
'noexcept nullptr static_assert thread_local restrict _Bool complex',
'noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginary',
built_in: 'std string cin cout cerr clog stringstream istringstream ostringstream ' +
'auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set ' +
'unordered_map unordered_multiset unordered_multimap array shared_ptr'
'unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos ' +
'asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp ' +
'fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper ' +
'isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow ' +
'printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp ' +
'strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan ' +
'vfprintf vprintf vsprintf'
};
return {
defaultMode: {
keywords: CPP_KEYWORDS,
illegal: '</',
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
{
className: 'string',
begin: '\'\\\\?.', end: '\'',
illegal: '.'
},
{
className: 'number',
begin: '\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)'
},
hljs.C_NUMBER_MODE,
{
className: 'preprocessor',
begin: '#', end: '$'
},
{
className: 'stl_container',
begin: '\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<', end: '>',
keywords: CPP_KEYWORDS,
relevance: 10,
contains: ['self']
}
]
}
aliases: ['c', 'h', 'c++', 'h++'],
keywords: CPP_KEYWORDS,
illegal: '</',
contains: [
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.QUOTE_STRING_MODE,
{
className: 'string',
begin: '\'\\\\?.', end: '\'',
illegal: '.'
},
{
className: 'number',
begin: '\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)'
},
hljs.C_NUMBER_MODE,
{
className: 'preprocessor',
begin: '#', end: '$',
keywords: 'if else elif endif define undef warning error line pragma',
contains: [
{
begin: 'include\\s*[<"]', end: '[>"]',
keywords: 'include',
illegal: '\\n'
},
hljs.C_LINE_COMMENT_MODE
]
},
{
className: 'stl_container',
begin: '\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<', end: '>',
keywords: CPP_KEYWORDS,
contains: ['self']
},
{
begin: hljs.IDENT_RE + '::'
}
]
};
}(hljs);
}