[483] | 1 | define(["../_base"], function(dh){ |
---|
| 2 | |
---|
| 3 | var dhc = dh.constants; |
---|
| 4 | dh.languages.cpp = { |
---|
| 5 | // summary: |
---|
| 6 | // C++ highlight definitions |
---|
| 7 | defaultMode: { |
---|
| 8 | lexems: [dhc.UNDERSCORE_IDENT_RE], |
---|
| 9 | illegal: '</', |
---|
| 10 | contains: ['comment', 'string', 'number', 'preprocessor'], |
---|
| 11 | keywords: { |
---|
| 12 | 'false': 1, 'int': 1, 'float': 1, 'while': 1, 'private': 1, |
---|
| 13 | 'char': 1, 'catch': 1, 'export': 1, 'virtual': 1, |
---|
| 14 | 'operator': 2, 'sizeof': 2, 'dynamic_cast': 2, 'typedef': 2, |
---|
| 15 | 'const_cast': 2, 'const': 1, 'struct': 1, 'for': 1, |
---|
| 16 | 'static_cast': 2, 'union': 1, 'namespace': 1, 'unsigned': 1, |
---|
| 17 | 'long': 1, 'throw': 1, 'volatile': 2, 'static': 1, |
---|
| 18 | 'protected': 1, 'bool': 1, 'template': 1, 'mutable': 1, |
---|
| 19 | 'if': 1, 'public': 1, 'friend': 2, 'do': 1, 'return': 1, |
---|
| 20 | 'goto': 1, 'auto': 1, 'void': 2, 'enum': 1, 'else': 1, |
---|
| 21 | 'break': 1, 'new': 1, 'extern': 1, 'using': 1, 'true': 1, |
---|
| 22 | 'class': 1, 'asm': 1, 'case': 1, 'typeid': 1, 'short': 1, |
---|
| 23 | 'reinterpret_cast': 2, 'default': 1, 'double': 1, |
---|
| 24 | 'register': 1, 'explicit': 1, 'signed': 1, 'typename': 1, |
---|
| 25 | 'try': 1, 'this': 1, 'switch': 1, 'continue': 1, 'wchar_t': 1, |
---|
| 26 | 'inline': 1, 'delete': 1 |
---|
| 27 | } |
---|
| 28 | }, |
---|
| 29 | modes: [ |
---|
| 30 | dhc.C_LINE_COMMENT_MODE, |
---|
| 31 | dhc.C_BLOCK_COMMENT_MODE, |
---|
| 32 | dhc.C_NUMBER_MODE, |
---|
| 33 | dhc.QUOTE_STRING_MODE, |
---|
| 34 | dhc.BACKSLASH_ESCAPE, |
---|
| 35 | { |
---|
| 36 | className: 'string', |
---|
| 37 | begin: '\'', |
---|
| 38 | end: '[^\\\\]\'', |
---|
| 39 | illegal: '[^\\\\][^\']' |
---|
| 40 | }, |
---|
| 41 | { |
---|
| 42 | className: 'preprocessor', |
---|
| 43 | begin: '#', end: '$' |
---|
| 44 | } |
---|
| 45 | ] |
---|
| 46 | }; |
---|
| 47 | |
---|
| 48 | return dh.languages.cpp; |
---|
| 49 | |
---|
| 50 | }); |
---|