Blame view

bower_components/prism/components/prism-c.js 886 Bytes
73bcce88   luigser   COMPONENTS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  Prism.languages.c = Prism.languages.extend('clike', {
  	'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/,
  	'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/
  });
  
  Prism.languages.insertBefore('c', 'string', {
  	'macro': {
  		// allow for multiline macro definitions
  		// spaces after the # character compile fine with gcc
  		pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,
  		lookbehind: true,
  		alias: 'property',
  		inside: {
  			// highlight the path of the include statement as a string
  			'string': {
  				pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,
  				lookbehind: true
  			}
  		}
  	}
  });
  
  delete Prism.languages.c['class-name'];
  delete Prism.languages.c['boolean'];