OLD | NEW |
1 Prism.languages.c = Prism.languages.extend('clike', { | 1 Prism.languages.c = Prism.languages.extend('clike', { |
2 'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|def
ault|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short
|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\
b/, | 2 'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|def
ault|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short
|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\
b/, |
3 » 'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/ | 3 » 'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/, |
| 4 » 'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i |
4 }); | 5 }); |
5 | 6 |
6 Prism.languages.insertBefore('c', 'string', { | 7 Prism.languages.insertBefore('c', 'string', { |
7 'macro': { | 8 'macro': { |
8 // allow for multiline macro definitions | 9 // allow for multiline macro definitions |
9 // spaces after the # character compile fine with gcc | 10 // spaces after the # character compile fine with gcc |
10 pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im, | 11 pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im, |
11 lookbehind: true, | 12 lookbehind: true, |
12 alias: 'property', | 13 alias: 'property', |
13 inside: { | 14 inside: { |
14 // highlight the path of the include statement as a stri
ng | 15 // highlight the path of the include statement as a stri
ng |
15 'string': { | 16 'string': { |
16 pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3
)/, | 17 pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3
)/, |
17 lookbehind: true | 18 lookbehind: true |
18 } | 19 } |
19 } | 20 } |
20 } | 21 } |
21 }); | 22 }); |
22 | 23 |
23 delete Prism.languages.c['class-name']; | 24 delete Prism.languages.c['class-name']; |
24 delete Prism.languages.c['boolean']; | 25 delete Prism.languages.c['boolean']; |
OLD | NEW |