Sha256: 24c43d6abb7e9e7da5e397fd4b5ae8b6ce59d6893d832739ff11b61cdfbc4c9b

Contents?: true

Size: 1015 Bytes

Versions: 7

Compression:

Stored size: 1015 Bytes

Contents

Prism.languages.c = Prism.languages.extend('clike', {
	// allow for c multiline strings
	'string': /("|')([^\n\\\1]|\\.|\\\r*\n)*?\1/g,
	'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/g,
	'operator': /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\//g
});

Prism.languages.insertBefore('c', 'string', {
	// property class reused for macro statements
	'property': {
		// allow for multiline macro definitions
		// spaces after the # character compile fine with gcc
		pattern: /((^|\n)\s*)#\s*[a-z]+([^\n\\]|\\.|\\\r*\n)*/gi,
		lookbehind: true,
		inside: {
			// highlight the path of the include statement as a string
			'string': {
				pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/g,
				lookbehind: true,
			}
		}
	}
});

delete Prism.languages.c['class-name'];
delete Prism.languages.c['boolean'];

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hyhyhy-1.0.0 lib/hyhyhy/structure/_includes/prism/components/prism-c.js
hyhyhy-0.0.9 lib/hyhyhy/structure/_includes/prism/components/prism-c.js
hyhyhy-0.0.8 lib/hyhyhy/structure/_includes/prism/components/prism-c.js
hyhyhy-0.0.7 lib/hyhyhy/structure/_includes/prism/components/prism-c.js
hyhyhy-0.0.6 lib/hyhyhy/structure/_includes/prism/components/prism-c.js
hyhyhy-0.0.5 lib/hyhyhy/structure/_includes/prism/components/prism-c.js
hyhyhy-0.0.4 lib/hyhyhy/structure/_includes/prism/components/prism-c.js