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

Side by Side Diff: lib/src/prism/components/prism-rust.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-ruby.min.js ('k') | lib/src/prism/components/prism-rust.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 /* TODO 1 /* TODO
2 Add support for Markdown notation inside doc comments 2 Add support for Markdown notation inside doc comments
3 Add support for nested block comments... 3 Add support for nested block comments...
4 Match closure params even when not followed by dash or brace 4 Match closure params even when not followed by dash or brace
5 Add better support for macro definition 5 Add better support for macro definition
6 */ 6 */
7 7
8 Prism.languages.rust = { 8 Prism.languages.rust = {
9 'comment': [ 9 'comment': [
10 { 10 {
11 pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, 11 pattern: /(^|[^\\])\/\*[\w\W]*?\*\//,
12 lookbehind: true 12 lookbehind: true
13 }, 13 },
14 { 14 {
15 » » » pattern: /(^|[^\\:])\/\/.*?(\r?\n|$)/, 15 » » » pattern: /(^|[^\\:])\/\/.*/,
16 lookbehind: true 16 lookbehind: true
17 } 17 }
18 ], 18 ],
19 'string': [ 19 'string': [
20 /b?r(#*)"(?:\\?.)*?"\1/, 20 /b?r(#*)"(?:\\?.)*?"\1/,
21 /b?("|')(?:\\?.)*?\1/ 21 /b?("|')(?:\\?.)*?\1/
22 ], 22 ],
23 'keyword': /\b(?:abstract|alignof|as|be|box|break|const|continue|crate|d o|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|match|mod|move|mut|off setof|once|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|tru e|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/, 23 'keyword': /\b(?:abstract|alignof|as|be|box|break|const|continue|crate|d o|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|match|mod|move|mut|off setof|once|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|tru e|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/,
24 24
25 'attribute': { 25 'attribute': {
26 pattern: /#!?\[.+?\]/, 26 pattern: /#!?\[.+?\]/,
27 alias: 'attr-name' 27 alias: 'attr-name'
28 }, 28 },
29 29
30 'function': [ 30 'function': [
31 /[a-z0-9_]+(?=\s*\()/i, 31 /[a-z0-9_]+(?=\s*\()/i,
32 // Macros can use parens or brackets 32 // Macros can use parens or brackets
33 /[a-z0-9_]+!(?=\s*\(|\[)/i 33 /[a-z0-9_]+!(?=\s*\(|\[)/i
34 ], 34 ],
35 'macro-rules': { 35 'macro-rules': {
36 pattern: /[a-z0-9_]+!/i, 36 pattern: /[a-z0-9_]+!/i,
37 alias: 'function' 37 alias: 'function'
38 }, 38 },
39 39
40 // Hex, oct, bin, dec numbers with visual separators and type suffix 40 // Hex, oct, bin, dec numbers with visual separators and type suffix
41 » 'number': /\b-?(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[0 1](?:_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32)?|f 32|f64))?\b/, 41 » 'number': /\b-?(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[0 1](?:_?[01])*|(\d(_?\d)*)?\.?\d(_?\d)*([Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64) ?|f32|f64))?\b/,
42 42
43 // Closure params should not be confused with bitwise OR | 43 // Closure params should not be confused with bitwise OR |
44 'closure-params': { 44 'closure-params': {
45 pattern: /\|[^|]*\|(?=\s*[{-])/, 45 pattern: /\|[^|]*\|(?=\s*[{-])/,
46 inside: { 46 inside: {
47 'punctuation': /[\|:,]/, 47 'punctuation': /[\|:,]/,
48 'operator': /[&*]/ 48 'operator': /[&*]/
49 } 49 }
50 }, 50 },
51 » 'punctuation': /[{}[\];(),.:]|->/, 51 » 'punctuation': /[{}[\];(),:]|\.+|->/,
52 » 'operator': /[-+]{1,2}|!=?|<=?|>=?|={1,3}|&&?|\|\|?|\*|\/|\^|%|<<|>>@/ 52 » 'operator': /[-+*\/%!^=]=?|@|&[&=]?|\|[|=]?|<<?=?|>>?=?/
53 }; 53 };
OLDNEW
« no previous file with comments | « lib/src/prism/components/prism-ruby.min.js ('k') | lib/src/prism/components/prism-rust.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698