Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: polymer_1.0.4/bower_components/prism/components/prism-c.js

Issue 1205703007: Add polymer 1.0 to npm_modules (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Renamed folder to 1.0.4 Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: polymer_1.0.4/bower_components/prism/components/prism-c.js
diff --git a/polymer_1.0.4/bower_components/prism/components/prism-c.js b/polymer_1.0.4/bower_components/prism/components/prism-c.js
new file mode 100644
index 0000000000000000000000000000000000000000..e9a01909f42751d6e804614911316caa2b4ba901
--- /dev/null
+++ b/polymer_1.0.4/bower_components/prism/components/prism-c.js
@@ -0,0 +1,26 @@
+Prism.languages.c = Prism.languages.extend('clike', {
+ // allow for c multiline strings
+ 'string': /("|')([^\n\\\1]|\\.|\\\r*\n)*?\1/,
+ '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': /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\//
+});
+
+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)*/i,
+ lookbehind: true,
+ 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'];

Powered by Google App Engine
This is Rietveld 408576698