Blame view

bower_components/prism/components/prism-c.js 1.3 KB
73bcce88   luigser   COMPONENTS
1
2
  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/,
eb240478   Luigi Serra   public room cards...
3
4
  	'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,
  	'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i
73bcce88   luigser   COMPONENTS
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  });
  
  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
f748e9cf   Luigi Serra   new controllet an...
19
20
21
22
23
24
  			},
  			// highlight macro directives as keywords
  			'directive': {
  				pattern: /(#\s*)\b(define|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,
  				lookbehind: true,
  				alias: 'keyword'
73bcce88   luigser   COMPONENTS
25
26
  			}
  		}
f748e9cf   Luigi Serra   new controllet an...
27
28
29
  	},
  	// highlight predefined macros as constants
  	'constant': /\b(__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|stdin|stdout|stderr)\b/
73bcce88   luigser   COMPONENTS
30
31
32
  });
  
  delete Prism.languages.c['class-name'];
eb240478   Luigi Serra   public room cards...
33
  delete Prism.languages.c['boolean'];