Skip to content

Commit

Permalink
Merge branch 'c-fixes' of https://github.com/rygorous/prism into gh-p…
Browse files Browse the repository at this point in the history
…ages

Conflicts:
	components/prism-c.js
	components/prism-c.min.js
	components/prism-clike.js
	components/prism-clike.min.js

+ added tests
  • Loading branch information
Golmote committed Sep 3, 2015
2 parents 2f9fe1e + a418b1a commit 4d64d07
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions components/prism-c.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/
'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,
'number': /\b-?(0x[\da-f]+|\d*\.?\d+(e[+-]?\d+)?)[fFuUlL]*\b/i
});

Prism.languages.insertBefore('c', 'string', {
Expand All @@ -21,4 +22,4 @@ Prism.languages.insertBefore('c', 'string', {
});

delete Prism.languages.c['class-name'];
delete Prism.languages.c['boolean'];
delete Prism.languages.c['boolean'];
2 changes: 1 addition & 1 deletion components/prism-c.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/prism-clike.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Prism.languages.clike = {
'keyword': /\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
'boolean': /\b(true|false)\b/,
'function': /[a-z0-9_]+(?=\()/i,
'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/,
'number': /\b-?(0x[\da-f]+|\d*\.?\d+(e[+-]?\d+)?)\b/i,
'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,
'punctuation': /[{}[\];(),.:]/
};
2 changes: 1 addition & 1 deletion components/prism-clike.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.

0 comments on commit 4d64d07

Please sign in to comment.