UNPKG

886 BJavaScriptView Raw
1Prism.languages.c = Prism.languages.extend('clike', {
2 'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|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': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/
4});
5
6Prism.languages.insertBefore('c', 'string', {
7 'macro': {
8 // allow for multiline macro definitions
9 // spaces after the # character compile fine with gcc
10 pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,
11 lookbehind: true,
12 alias: 'property',
13 inside: {
14 // highlight the path of the include statement as a string
15 'string': {
16 pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,
17 lookbehind: true
18 }
19 }
20 }
21});
22
23delete Prism.languages.c['class-name'];
24delete Prism.languages.c['boolean'];
\No newline at end of file