OLD | NEW |
(Empty) | |
| 1 (function(Prism) { |
| 2 Prism.languages.crystal = Prism.languages.extend('ruby', { |
| 3 keyword: [ |
| 4 /\b(?:abstract|alias|as|asm|begin|break|case|class|def|d
o|else|elsif|end|ensure|enum|extend|for|fun|if|ifdef|include|instance_sizeof|lib
|macro|module|next|of|out|pointerof|private|protected|rescue|return|require|self
|sizeof|struct|super|then|type|typeof|union|unless|until|when|while|with|yield|_
_DIR__|__FILE__|__LINE__)\b/, |
| 5 { |
| 6 pattern: /(\.\s*)(?:is_a|responds_to)\?/, |
| 7 lookbehind: true |
| 8 } |
| 9 ], |
| 10 |
| 11 number: /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[0-9a-fA-F_]*[0-9a-f
A-F]|(?:[0-9](?:[0-9_]*[0-9])?)(?:\.[0-9_]*[0-9])?(?:[eE][+-]?[0-9_]*[0-9])?)(?:
_(?:[uif](?:8|16|32|64))?)?\b/, |
| 12 }); |
| 13 |
| 14 var rest = Prism.util.clone(Prism.languages.crystal); |
| 15 |
| 16 Prism.languages.insertBefore('crystal', 'string', { |
| 17 attribute: { |
| 18 pattern: /@\[.+?\]/, |
| 19 alias: 'attr-name', |
| 20 inside: { |
| 21 delimiter: { |
| 22 pattern: /^@\[|\]$/, |
| 23 alias: 'tag' |
| 24 }, |
| 25 rest: rest |
| 26 } |
| 27 }, |
| 28 |
| 29 expansion: [ |
| 30 { |
| 31 pattern: /\{\{.+?\}\}/, |
| 32 inside: { |
| 33 delimiter: { |
| 34 pattern: /^\{\{|\}\}$/, |
| 35 alias: 'tag' |
| 36 }, |
| 37 rest: rest |
| 38 } |
| 39 }, |
| 40 { |
| 41 pattern: /\{%.+?%\}/, |
| 42 inside: { |
| 43 delimiter: { |
| 44 pattern: /^\{%|%\}$/, |
| 45 alias: 'tag' |
| 46 }, |
| 47 rest: rest |
| 48 } |
| 49 } |
| 50 ] |
| 51 }); |
| 52 |
| 53 }(Prism)); |
OLD | NEW |