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

Side by Side Diff: lib/src/prism/components/prism-c.js

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « lib/src/prism/components/prism-bison.min.js ('k') | lib/src/prism/components/prism-c.min.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Prism.languages.c = Prism.languages.extend('clike', { 1 Prism.languages.c = Prism.languages.extend('clike', {
2 'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|def ault|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/, 2 'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|def ault|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/,
3 » 'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/ 3 » 'operator': /\-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*\/]/,
4 » 'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i
4 }); 5 });
5 6
6 Prism.languages.insertBefore('c', 'string', { 7 Prism.languages.insertBefore('c', 'string', {
7 'macro': { 8 'macro': {
8 // allow for multiline macro definitions 9 // allow for multiline macro definitions
9 // spaces after the # character compile fine with gcc 10 // spaces after the # character compile fine with gcc
10 pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im, 11 pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,
11 lookbehind: true, 12 lookbehind: true,
12 alias: 'property', 13 alias: 'property',
13 inside: { 14 inside: {
14 // highlight the path of the include statement as a stri ng 15 // highlight the path of the include statement as a stri ng
15 'string': { 16 'string': {
16 pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3 )/, 17 pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3 )/,
17 lookbehind: true 18 lookbehind: true
18 } 19 }
19 } 20 }
20 } 21 }
21 }); 22 });
22 23
23 delete Prism.languages.c['class-name']; 24 delete Prism.languages.c['class-name'];
24 delete Prism.languages.c['boolean']; 25 delete Prism.languages.c['boolean'];
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-bison.min.js ('k') | lib/src/prism/components/prism-c.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698