@dangl/angular-material-shared 2.3.3-beta0004 → 2.4.0-beta0015

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/esm2020/lib/angular-material-shared.module.mjs +4 -4
  2. package/esm2020/lib/components/footer/footer.component.mjs +3 -3
  3. package/esm2020/lib/components/header/header.component.mjs +4 -4
  4. package/esm2020/lib/components/tiny-mce/tiny-mce.component.mjs +3 -3
  5. package/fesm2015/dangl-angular-material-shared.mjs +14 -14
  6. package/fesm2015/dangl-angular-material-shared.mjs.map +1 -1
  7. package/fesm2020/dangl-angular-material-shared.mjs +14 -14
  8. package/fesm2020/dangl-angular-material-shared.mjs.map +1 -1
  9. package/lib/components/footer/footer.component.d.ts +1 -1
  10. package/lib/components/header/header.component.d.ts +1 -1
  11. package/lib/components/tiny-mce/tiny-mce.component.d.ts +1 -1
  12. package/package.json +9 -9
  13. package/styles/material-style.scss +3 -0
  14. package/styles/material-theme.scss +11 -1
  15. package/styles/material-variables.scss +11 -3
  16. package/tinymce-assets/plugins/advlist/plugin.js +1 -1
  17. package/tinymce-assets/plugins/advlist/plugin.min.js +1 -1
  18. package/tinymce-assets/plugins/anchor/plugin.js +1 -1
  19. package/tinymce-assets/plugins/anchor/plugin.min.js +1 -1
  20. package/tinymce-assets/plugins/autolink/plugin.js +2 -2
  21. package/tinymce-assets/plugins/autolink/plugin.min.js +2 -2
  22. package/tinymce-assets/plugins/autoresize/plugin.js +1 -1
  23. package/tinymce-assets/plugins/autoresize/plugin.min.js +1 -1
  24. package/tinymce-assets/plugins/autosave/plugin.js +1 -1
  25. package/tinymce-assets/plugins/autosave/plugin.min.js +1 -1
  26. package/tinymce-assets/plugins/bbcode/plugin.js +1 -1
  27. package/tinymce-assets/plugins/bbcode/plugin.min.js +1 -1
  28. package/tinymce-assets/plugins/charmap/plugin.js +1 -1
  29. package/tinymce-assets/plugins/charmap/plugin.min.js +1 -1
  30. package/tinymce-assets/plugins/code/plugin.js +1 -1
  31. package/tinymce-assets/plugins/code/plugin.min.js +1 -1
  32. package/tinymce-assets/plugins/codesample/plugin.js +268 -145
  33. package/tinymce-assets/plugins/codesample/plugin.min.js +2 -2
  34. package/tinymce-assets/plugins/colorpicker/plugin.js +1 -1
  35. package/tinymce-assets/plugins/colorpicker/plugin.min.js +1 -1
  36. package/tinymce-assets/plugins/contextmenu/plugin.js +1 -1
  37. package/tinymce-assets/plugins/contextmenu/plugin.min.js +1 -1
  38. package/tinymce-assets/plugins/directionality/plugin.js +1 -1
  39. package/tinymce-assets/plugins/directionality/plugin.min.js +1 -1
  40. package/tinymce-assets/plugins/emoticons/plugin.js +1 -1
  41. package/tinymce-assets/plugins/emoticons/plugin.min.js +1 -1
  42. package/tinymce-assets/plugins/fullpage/plugin.js +1 -1
  43. package/tinymce-assets/plugins/fullpage/plugin.min.js +1 -1
  44. package/tinymce-assets/plugins/fullscreen/plugin.js +2 -1
  45. package/tinymce-assets/plugins/fullscreen/plugin.min.js +2 -2
  46. package/tinymce-assets/plugins/help/plugin.js +1 -1
  47. package/tinymce-assets/plugins/help/plugin.min.js +1 -1
  48. package/tinymce-assets/plugins/hr/plugin.js +1 -1
  49. package/tinymce-assets/plugins/hr/plugin.min.js +1 -1
  50. package/tinymce-assets/plugins/image/plugin.js +1 -1
  51. package/tinymce-assets/plugins/image/plugin.min.js +1 -1
  52. package/tinymce-assets/plugins/imagetools/plugin.js +1 -1
  53. package/tinymce-assets/plugins/imagetools/plugin.min.js +1 -1
  54. package/tinymce-assets/plugins/importcss/plugin.js +1 -1
  55. package/tinymce-assets/plugins/importcss/plugin.min.js +1 -1
  56. package/tinymce-assets/plugins/insertdatetime/plugin.js +1 -1
  57. package/tinymce-assets/plugins/insertdatetime/plugin.min.js +1 -1
  58. package/tinymce-assets/plugins/legacyoutput/plugin.js +1 -1
  59. package/tinymce-assets/plugins/legacyoutput/plugin.min.js +1 -1
  60. package/tinymce-assets/plugins/link/plugin.js +1 -1
  61. package/tinymce-assets/plugins/link/plugin.min.js +1 -1
  62. package/tinymce-assets/plugins/lists/plugin.js +1 -1
  63. package/tinymce-assets/plugins/lists/plugin.min.js +1 -1
  64. package/tinymce-assets/plugins/media/plugin.js +1 -1
  65. package/tinymce-assets/plugins/media/plugin.min.js +1 -1
  66. package/tinymce-assets/plugins/nonbreaking/plugin.js +1 -1
  67. package/tinymce-assets/plugins/nonbreaking/plugin.min.js +1 -1
  68. package/tinymce-assets/plugins/noneditable/plugin.js +1 -1
  69. package/tinymce-assets/plugins/noneditable/plugin.min.js +1 -1
  70. package/tinymce-assets/plugins/pagebreak/plugin.js +1 -1
  71. package/tinymce-assets/plugins/pagebreak/plugin.min.js +1 -1
  72. package/tinymce-assets/plugins/paste/plugin.js +2 -2
  73. package/tinymce-assets/plugins/paste/plugin.min.js +2 -2
  74. package/tinymce-assets/plugins/preview/plugin.js +1 -1
  75. package/tinymce-assets/plugins/preview/plugin.min.js +1 -1
  76. package/tinymce-assets/plugins/print/plugin.js +1 -1
  77. package/tinymce-assets/plugins/print/plugin.min.js +1 -1
  78. package/tinymce-assets/plugins/quickbars/plugin.js +1 -1
  79. package/tinymce-assets/plugins/quickbars/plugin.min.js +1 -1
  80. package/tinymce-assets/plugins/save/plugin.js +1 -1
  81. package/tinymce-assets/plugins/save/plugin.min.js +1 -1
  82. package/tinymce-assets/plugins/searchreplace/plugin.js +1 -1
  83. package/tinymce-assets/plugins/searchreplace/plugin.min.js +1 -1
  84. package/tinymce-assets/plugins/spellchecker/plugin.js +1 -1
  85. package/tinymce-assets/plugins/spellchecker/plugin.min.js +1 -1
  86. package/tinymce-assets/plugins/tabfocus/plugin.js +1 -1
  87. package/tinymce-assets/plugins/tabfocus/plugin.min.js +1 -1
  88. package/tinymce-assets/plugins/table/plugin.js +1 -1
  89. package/tinymce-assets/plugins/table/plugin.min.js +1 -1
  90. package/tinymce-assets/plugins/template/plugin.js +1 -1
  91. package/tinymce-assets/plugins/template/plugin.min.js +1 -1
  92. package/tinymce-assets/plugins/textcolor/plugin.js +1 -1
  93. package/tinymce-assets/plugins/textcolor/plugin.min.js +1 -1
  94. package/tinymce-assets/plugins/textpattern/plugin.js +1 -1
  95. package/tinymce-assets/plugins/textpattern/plugin.min.js +1 -1
  96. package/tinymce-assets/plugins/toc/plugin.js +1 -1
  97. package/tinymce-assets/plugins/toc/plugin.min.js +1 -1
  98. package/tinymce-assets/plugins/visualblocks/plugin.js +1 -1
  99. package/tinymce-assets/plugins/visualblocks/plugin.min.js +1 -1
  100. package/tinymce-assets/plugins/visualchars/plugin.js +1 -1
  101. package/tinymce-assets/plugins/visualchars/plugin.min.js +1 -1
  102. package/tinymce-assets/plugins/wordcount/plugin.js +1 -1
  103. package/tinymce-assets/plugins/wordcount/plugin.min.js +1 -1
  104. package/tinymce-assets/themes/mobile/theme.js +1 -1
  105. package/tinymce-assets/themes/mobile/theme.min.js +1 -1
  106. package/tinymce-assets/themes/silver/theme.js +1632 -72
  107. package/tinymce-assets/themes/silver/theme.min.js +2 -2
@@ -4,7 +4,7 @@
4
4
  * For LGPL see License.txt in the project root for license information.
5
5
  * For commercial licenses see https://www.tiny.cloud/
6
6
  *
7
- * Version: 5.10.3 (2022-02-09)
7
+ * Version: 5.10.7 (2022-12-06)
8
8
  */
9
9
  (function () {
10
10
  'use strict';
@@ -149,7 +149,7 @@
149
149
  (function (module) {
150
150
  var _self = typeof window !== 'undefined' ? window : typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : {};
151
151
  var Prism = function (_self) {
152
- var lang = /\blang(?:uage)?-([\w-]+)\b/i;
152
+ var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
153
153
  var uniqueId = 0;
154
154
  var plainTextGrammar = {};
155
155
  var _ = {
@@ -208,17 +208,19 @@
208
208
  }
209
209
  },
210
210
  getLanguage: function (element) {
211
- while (element && !lang.test(element.className)) {
211
+ while (element) {
212
+ var m = lang.exec(element.className);
213
+ if (m) {
214
+ return m[1].toLowerCase();
215
+ }
212
216
  element = element.parentElement;
213
217
  }
214
- if (element) {
215
- return (element.className.match(lang) || [
216
- ,
217
- 'none'
218
- ])[1].toLowerCase();
219
- }
220
218
  return 'none';
221
219
  },
220
+ setLanguage: function (element, language) {
221
+ element.className = element.className.replace(RegExp(lang.source, 'gi'), '');
222
+ element.classList.add('language-' + language);
223
+ },
222
224
  currentScript: function () {
223
225
  if (typeof document === 'undefined') {
224
226
  return null;
@@ -334,10 +336,10 @@
334
336
  highlightElement: function (element, async, callback) {
335
337
  var language = _.util.getLanguage(element);
336
338
  var grammar = _.languages[language];
337
- element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
339
+ _.util.setLanguage(element, language);
338
340
  var parent = element.parentElement;
339
341
  if (parent && parent.nodeName.toLowerCase() === 'pre') {
340
- parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
342
+ _.util.setLanguage(parent, language);
341
343
  }
342
344
  var code = element.textContent;
343
345
  var env = {
@@ -390,6 +392,9 @@
390
392
  language: language
391
393
  };
392
394
  _.hooks.run('before-tokenize', env);
395
+ if (!env.grammar) {
396
+ throw new Error('The language "' + env.language + '" has no grammar.');
397
+ }
393
398
  env.tokens = _.tokenize(env.code, env.grammar);
394
399
  _.hooks.run('after-tokenize', env);
395
400
  return Token.stringify(_.util.encode(env.tokens), env.language);
@@ -516,7 +521,7 @@
516
521
  var match;
517
522
  if (greedy) {
518
523
  match = matchPattern(pattern, pos, text, lookbehind);
519
- if (!match) {
524
+ if (!match || match.index >= text.length) {
520
525
  break;
521
526
  }
522
527
  var from = match.index;
@@ -693,12 +698,12 @@
693
698
  greedy: true
694
699
  },
695
700
  'class-name': {
696
- pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
701
+ pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
697
702
  lookbehind: true,
698
703
  inside: { 'punctuation': /[.\\]/ }
699
704
  },
700
- 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
701
- 'boolean': /\b(?:true|false)\b/,
705
+ 'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
706
+ 'boolean': /\b(?:false|true)\b/,
702
707
  'function': /\b\w+(?=\()/,
703
708
  'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
704
709
  'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
@@ -788,15 +793,25 @@
788
793
  pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
789
794
  greedy: true
790
795
  },
796
+ 'string': {
797
+ pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
798
+ greedy: true
799
+ },
791
800
  'class-name': {
792
801
  pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
793
802
  lookbehind: true
794
803
  },
795
- 'keyword': /\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|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/,
804
+ 'keyword': /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,
796
805
  'function': /\b[a-z_]\w*(?=\s*\()/i,
797
806
  'number': /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
798
807
  'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
799
808
  });
809
+ Prism.languages.insertBefore('c', 'string', {
810
+ 'char': {
811
+ pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,
812
+ greedy: true
813
+ }
814
+ });
800
815
  Prism.languages.insertBefore('c', 'string', {
801
816
  'macro': {
802
817
  pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
@@ -811,6 +826,7 @@
811
826
  },
812
827
  Prism.languages.c['string']
813
828
  ],
829
+ 'char': Prism.languages.c['char'],
814
830
  'comment': Prism.languages.c['comment'],
815
831
  'macro-name': [
816
832
  {
@@ -835,12 +851,12 @@
835
851
  inside: Prism.languages.c
836
852
  }
837
853
  }
838
- },
839
- 'constant': /\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/
854
+ }
840
855
  });
856
+ Prism.languages.insertBefore('c', 'function', { 'constant': /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/ });
841
857
  delete Prism.languages.c['boolean'];
842
858
  (function (Prism) {
843
- var keyword = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;
859
+ var keyword = /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/;
844
860
  var modName = /\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g, function () {
845
861
  return keyword.source;
846
862
  });
@@ -862,11 +878,11 @@
862
878
  greedy: true
863
879
  },
864
880
  'operator': />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,
865
- 'boolean': /\b(?:true|false)\b/
881
+ 'boolean': /\b(?:false|true)\b/
866
882
  });
867
883
  Prism.languages.insertBefore('cpp', 'string', {
868
884
  'module': {
869
- pattern: RegExp(/(\b(?:module|import)\s+)/.source + '(?:' + /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + '|' + /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g, function () {
885
+ pattern: RegExp(/(\b(?:import|module)\s+)/.source + '(?:' + /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + '|' + /<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g, function () {
870
886
  return modName;
871
887
  }) + ')'),
872
888
  lookbehind: true,
@@ -987,11 +1003,6 @@
987
1003
  pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]),
988
1004
  lookbehind: true,
989
1005
  greedy: true
990
- },
991
- {
992
- pattern: RegExp(character),
993
- greedy: true,
994
- alias: 'character'
995
1006
  }
996
1007
  ],
997
1008
  'class-name': [
@@ -1044,7 +1055,7 @@
1044
1055
  }
1045
1056
  ],
1046
1057
  'keyword': keywords,
1047
- 'number': /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i,
1058
+ 'number': /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,
1048
1059
  'operator': />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,
1049
1060
  'punctuation': /\?\.?|::|[{}[\];(),.:]/
1050
1061
  });
@@ -1068,7 +1079,7 @@
1068
1079
  inside: { 'punctuation': /\./ }
1069
1080
  },
1070
1081
  'type-expression': {
1071
- pattern: re(/(\b(?:default|typeof|sizeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source, [nestedRound]),
1082
+ pattern: re(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source, [nestedRound]),
1072
1083
  lookbehind: true,
1073
1084
  alias: 'class-name',
1074
1085
  inside: typeInside
@@ -1227,16 +1238,20 @@
1227
1238
  greedy: true,
1228
1239
  inside: createInterpolationInside(sInterpolation, sInterpolationRound)
1229
1240
  }
1230
- ]
1241
+ ],
1242
+ 'char': {
1243
+ pattern: RegExp(character),
1244
+ greedy: true
1245
+ }
1231
1246
  });
1247
+ Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;
1232
1248
  }(Prism));
1233
- Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp;
1234
1249
  (function (Prism) {
1235
1250
  var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1236
1251
  Prism.languages.css = {
1237
1252
  'comment': /\/\*[\s\S]*?\*\//,
1238
1253
  'atrule': {
1239
- pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,
1254
+ pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
1240
1255
  inside: {
1241
1256
  'rule': /^@[\w-]+/,
1242
1257
  'selector-function-argument': {
@@ -1289,10 +1304,10 @@
1289
1304
  }
1290
1305
  }(Prism));
1291
1306
  (function (Prism) {
1292
- var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;
1293
- var classNamePrefix = /(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source;
1307
+ var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/;
1308
+ var classNamePrefix = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source;
1294
1309
  var className = {
1295
- pattern: RegExp(classNamePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
1310
+ pattern: RegExp(/(^|[^\w.])/.source + classNamePrefix + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
1296
1311
  lookbehind: true,
1297
1312
  inside: {
1298
1313
  'namespace': {
@@ -1303,10 +1318,20 @@
1303
1318
  }
1304
1319
  };
1305
1320
  Prism.languages.java = Prism.languages.extend('clike', {
1321
+ 'string': {
1322
+ pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
1323
+ lookbehind: true,
1324
+ greedy: true
1325
+ },
1306
1326
  'class-name': [
1307
1327
  className,
1308
1328
  {
1309
- pattern: RegExp(classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),
1329
+ pattern: RegExp(/(^|[^\w.])/.source + classNamePrefix + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
1330
+ lookbehind: true,
1331
+ inside: className.inside
1332
+ },
1333
+ {
1334
+ pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + classNamePrefix + /[A-Z]\w*\b/.source),
1310
1335
  lookbehind: true,
1311
1336
  inside: className.inside
1312
1337
  }
@@ -1323,13 +1348,18 @@
1323
1348
  'operator': {
1324
1349
  pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,
1325
1350
  lookbehind: true
1326
- }
1351
+ },
1352
+ 'constant': /\b[A-Z][A-Z_\d]+\b/
1327
1353
  });
1328
1354
  Prism.languages.insertBefore('java', 'string', {
1329
1355
  'triple-quoted-string': {
1330
1356
  pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
1331
1357
  greedy: true,
1332
1358
  alias: 'string'
1359
+ },
1360
+ 'char': {
1361
+ pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
1362
+ greedy: true
1333
1363
  }
1334
1364
  });
1335
1365
  Prism.languages.insertBefore('java', 'class-name', {
@@ -1347,6 +1377,30 @@
1347
1377
  'operator': /[?&|]/
1348
1378
  }
1349
1379
  },
1380
+ 'import': [
1381
+ {
1382
+ pattern: RegExp(/(\bimport\s+)/.source + classNamePrefix + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
1383
+ lookbehind: true,
1384
+ inside: {
1385
+ 'namespace': className.inside.namespace,
1386
+ 'punctuation': /\./,
1387
+ 'operator': /\*/,
1388
+ 'class-name': /\w+/
1389
+ }
1390
+ },
1391
+ {
1392
+ pattern: RegExp(/(\bimport\s+static\s+)/.source + classNamePrefix + /(?:\w+|\*)(?=\s*;)/.source),
1393
+ lookbehind: true,
1394
+ alias: 'static',
1395
+ inside: {
1396
+ 'namespace': className.inside.namespace,
1397
+ 'static': /\b\w+$/,
1398
+ 'punctuation': /\./,
1399
+ 'operator': /\*/,
1400
+ 'class-name': /\w+/
1401
+ }
1402
+ }
1403
+ ],
1350
1404
  'namespace': {
1351
1405
  pattern: RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g, function () {
1352
1406
  return keywords.source;
@@ -1360,7 +1414,7 @@
1360
1414
  'class-name': [
1361
1415
  Prism.languages.clike['class-name'],
1362
1416
  {
1363
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,
1417
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1364
1418
  lookbehind: true
1365
1419
  }
1366
1420
  ],
@@ -1375,13 +1429,16 @@
1375
1429
  }
1376
1430
  ],
1377
1431
  'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1378
- 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,
1432
+ 'number': {
1433
+ pattern: RegExp(/(^|[^\w$])/.source + '(?:' + (/NaN|Infinity/.source + '|' + /0[bB][01]+(?:_[01]+)*n?/.source + '|' + /0[oO][0-7]+(?:_[0-7]+)*n?/.source + '|' + /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + '|' + /\d+(?:_\d+)*n/.source + '|' + /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ')' + /(?![\w$])/.source),
1434
+ lookbehind: true
1435
+ },
1379
1436
  'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1380
1437
  });
1381
- Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
1438
+ Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
1382
1439
  Prism.languages.insertBefore('javascript', 'keyword', {
1383
1440
  'regex': {
1384
- pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,
1441
+ pattern: RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + /\//.source + '(?:' + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + '|' + /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ')' + /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),
1385
1442
  lookbehind: true,
1386
1443
  greedy: true,
1387
1444
  inside: {
@@ -1450,6 +1507,19 @@
1450
1507
  },
1451
1508
  'string': /[\s\S]+/
1452
1509
  }
1510
+ },
1511
+ 'string-property': {
1512
+ pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
1513
+ lookbehind: true,
1514
+ greedy: true,
1515
+ alias: 'property'
1516
+ }
1517
+ });
1518
+ Prism.languages.insertBefore('javascript', 'operator', {
1519
+ 'literal-property': {
1520
+ pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
1521
+ lookbehind: true,
1522
+ alias: 'property'
1453
1523
  }
1454
1524
  });
1455
1525
  if (Prism.languages.markup) {
@@ -1509,7 +1579,10 @@
1509
1579
  pattern: /^=/,
1510
1580
  alias: 'attr-equals'
1511
1581
  },
1512
- /"|'/
1582
+ {
1583
+ pattern: /^(\s*)["']|["']$/,
1584
+ lookbehind: true
1585
+ }
1513
1586
  ]
1514
1587
  }
1515
1588
  },
@@ -1634,7 +1707,7 @@
1634
1707
  alias: 'important'
1635
1708
  },
1636
1709
  'comment': comment,
1637
- 'variable': /\$+(?:\w+\b|(?=\{))/i,
1710
+ 'variable': /\$+(?:\w+\b|(?=\{))/,
1638
1711
  'package': {
1639
1712
  pattern: /(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,
1640
1713
  lookbehind: true,
@@ -1652,42 +1725,30 @@
1652
1725
  },
1653
1726
  'keyword': [
1654
1727
  {
1655
- pattern: /(\(\s*)\b(?:bool|boolean|int|integer|float|string|object|array)\b(?=\s*\))/i,
1728
+ pattern: /(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,
1656
1729
  alias: 'type-casting',
1657
1730
  greedy: true,
1658
1731
  lookbehind: true
1659
1732
  },
1660
1733
  {
1661
- pattern: /([(,?]\s*)\b(?:bool|int|float|string|object|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b(?=\s*\$)/i,
1662
- alias: 'type-hint',
1663
- greedy: true,
1664
- lookbehind: true
1665
- },
1666
- {
1667
- pattern: /([(,?]\s*[\w|]\|\s*)(?:null|false)\b(?=\s*\$)/i,
1734
+ pattern: /([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,
1668
1735
  alias: 'type-hint',
1669
1736
  greedy: true,
1670
1737
  lookbehind: true
1671
1738
  },
1672
1739
  {
1673
- pattern: /(\)\s*:\s*(?:\?\s*)?)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i,
1740
+ pattern: /(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,
1674
1741
  alias: 'return-type',
1675
1742
  greedy: true,
1676
1743
  lookbehind: true
1677
1744
  },
1678
1745
  {
1679
- pattern: /(\)\s*:\s*(?:\?\s*)?[\w|]\|\s*)(?:null|false)\b/i,
1680
- alias: 'return-type',
1681
- greedy: true,
1682
- lookbehind: true
1683
- },
1684
- {
1685
- pattern: /\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i,
1746
+ pattern: /\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,
1686
1747
  alias: 'type-declaration',
1687
1748
  greedy: true
1688
1749
  },
1689
1750
  {
1690
- pattern: /(\|\s*)(?:null|false)\b/i,
1751
+ pattern: /(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,
1691
1752
  alias: 'type-declaration',
1692
1753
  greedy: true,
1693
1754
  lookbehind: true
@@ -1703,12 +1764,12 @@
1703
1764
  },
1704
1765
  /\bclass\b/i,
1705
1766
  {
1706
- pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,
1767
+ pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,
1707
1768
  lookbehind: true
1708
1769
  }
1709
1770
  ],
1710
1771
  'argument-name': {
1711
- pattern: /([(,]\s+)\b[a-z_]\w*(?=\s*:(?!:))/i,
1772
+ pattern: /([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,
1712
1773
  lookbehind: true
1713
1774
  },
1714
1775
  'class-name': [
@@ -1916,7 +1977,7 @@
1916
1977
  if (!/<\?/.test(env.code)) {
1917
1978
  return;
1918
1979
  }
1919
- var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/gi;
1980
+ var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;
1920
1981
  Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern);
1921
1982
  });
1922
1983
  Prism.hooks.add('after-tokenize', function (env) {
@@ -1926,10 +1987,11 @@
1926
1987
  Prism.languages.python = {
1927
1988
  'comment': {
1928
1989
  pattern: /(^|[^\\])#.*/,
1929
- lookbehind: true
1990
+ lookbehind: true,
1991
+ greedy: true
1930
1992
  },
1931
1993
  'string-interpolation': {
1932
- pattern: /(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
1994
+ pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
1933
1995
  greedy: true,
1934
1996
  inside: {
1935
1997
  'interpolation': {
@@ -1951,12 +2013,12 @@
1951
2013
  }
1952
2014
  },
1953
2015
  'triple-quoted-string': {
1954
- pattern: /(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i,
2016
+ pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
1955
2017
  greedy: true,
1956
2018
  alias: 'string'
1957
2019
  },
1958
2020
  'string': {
1959
- pattern: /(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
2021
+ pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
1960
2022
  greedy: true
1961
2023
  },
1962
2024
  'function': {
@@ -1968,7 +2030,7 @@
1968
2030
  lookbehind: true
1969
2031
  },
1970
2032
  'decorator': {
1971
- pattern: /(^[\t ]*)@\w+(?:\.\w+)*/im,
2033
+ pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
1972
2034
  lookbehind: true,
1973
2035
  alias: [
1974
2036
  'annotation',
@@ -1976,123 +2038,184 @@
1976
2038
  ],
1977
2039
  inside: { 'punctuation': /\./ }
1978
2040
  },
1979
- 'keyword': /\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
2041
+ 'keyword': /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
1980
2042
  'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
1981
- 'boolean': /\b(?:True|False|None)\b/,
1982
- 'number': /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?\b/i,
1983
- 'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
2043
+ 'boolean': /\b(?:False|None|True)\b/,
2044
+ 'number': /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
2045
+ 'operator': /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
1984
2046
  'punctuation': /[{}[\];(),.:]/
1985
2047
  };
1986
2048
  Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;
1987
2049
  Prism.languages.py = Prism.languages.python;
1988
2050
  (function (Prism) {
1989
2051
  Prism.languages.ruby = Prism.languages.extend('clike', {
1990
- 'comment': [
1991
- /#.*/,
1992
- {
1993
- pattern: /^=begin\s[\s\S]*?^=end/m,
1994
- greedy: true
1995
- }
1996
- ],
2052
+ 'comment': {
2053
+ pattern: /#.*|^=begin\s[\s\S]*?^=end/m,
2054
+ greedy: true
2055
+ },
1997
2056
  'class-name': {
1998
- pattern: /(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,
2057
+ pattern: /(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,
1999
2058
  lookbehind: true,
2000
2059
  inside: { 'punctuation': /[.\\]/ }
2001
2060
  },
2002
- 'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/
2061
+ 'keyword': /\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,
2062
+ 'operator': /\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,
2063
+ 'punctuation': /[(){}[\].,;]/
2064
+ });
2065
+ Prism.languages.insertBefore('ruby', 'operator', {
2066
+ 'double-colon': {
2067
+ pattern: /::/,
2068
+ alias: 'punctuation'
2069
+ }
2003
2070
  });
2004
2071
  var interpolation = {
2005
- pattern: /#\{[^}]+\}/,
2072
+ pattern: /((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,
2073
+ lookbehind: true,
2006
2074
  inside: {
2075
+ 'content': {
2076
+ pattern: /^(#\{)[\s\S]+(?=\}$)/,
2077
+ lookbehind: true,
2078
+ inside: Prism.languages.ruby
2079
+ },
2007
2080
  'delimiter': {
2008
2081
  pattern: /^#\{|\}$/,
2009
- alias: 'tag'
2010
- },
2011
- rest: Prism.languages.ruby
2082
+ alias: 'punctuation'
2083
+ }
2012
2084
  }
2013
2085
  };
2014
2086
  delete Prism.languages.ruby.function;
2087
+ var percentExpression = '(?:' + [
2088
+ /([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
2089
+ /\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,
2090
+ /\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,
2091
+ /\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,
2092
+ /<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source
2093
+ ].join('|') + ')';
2094
+ var symbolName = /(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;
2015
2095
  Prism.languages.insertBefore('ruby', 'keyword', {
2016
- 'regex': [
2096
+ 'regex-literal': [
2017
2097
  {
2018
- pattern: RegExp(/%r/.source + '(?:' + [
2019
- /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
2020
- /\((?:[^()\\]|\\[\s\S])*\)/.source,
2021
- /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,
2022
- /\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,
2023
- /<(?:[^<>\\]|\\[\s\S])*>/.source
2024
- ].join('|') + ')' + /[egimnosux]{0,6}/.source),
2098
+ pattern: RegExp(/%r/.source + percentExpression + /[egimnosux]{0,6}/.source),
2025
2099
  greedy: true,
2026
- inside: { 'interpolation': interpolation }
2100
+ inside: {
2101
+ 'interpolation': interpolation,
2102
+ 'regex': /[\s\S]+/
2103
+ }
2027
2104
  },
2028
2105
  {
2029
2106
  pattern: /(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,
2030
2107
  lookbehind: true,
2031
2108
  greedy: true,
2032
- inside: { 'interpolation': interpolation }
2109
+ inside: {
2110
+ 'interpolation': interpolation,
2111
+ 'regex': /[\s\S]+/
2112
+ }
2033
2113
  }
2034
2114
  ],
2035
2115
  'variable': /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,
2036
- 'symbol': {
2037
- pattern: /(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,
2038
- lookbehind: true
2039
- },
2116
+ 'symbol': [
2117
+ {
2118
+ pattern: RegExp(/(^|[^:]):/.source + symbolName),
2119
+ lookbehind: true,
2120
+ greedy: true
2121
+ },
2122
+ {
2123
+ pattern: RegExp(/([\r\n{(,][ \t]*)/.source + symbolName + /(?=:(?!:))/.source),
2124
+ lookbehind: true,
2125
+ greedy: true
2126
+ }
2127
+ ],
2040
2128
  'method-definition': {
2041
- pattern: /(\bdef\s+)[\w.]+/,
2129
+ pattern: /(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,
2042
2130
  lookbehind: true,
2043
2131
  inside: {
2044
- 'function': /\w+$/,
2045
- rest: Prism.languages.ruby
2132
+ 'function': /\b\w+$/,
2133
+ 'keyword': /^self\b/,
2134
+ 'class-name': /^\w+/,
2135
+ 'punctuation': /\./
2046
2136
  }
2047
2137
  }
2048
2138
  });
2049
- Prism.languages.insertBefore('ruby', 'number', {
2050
- 'builtin': /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,
2051
- 'constant': /\b[A-Z]\w*(?:[?!]|\b)/
2052
- });
2053
- Prism.languages.ruby.string = [
2054
- {
2055
- pattern: RegExp(/%[qQiIwWxs]?/.source + '(?:' + [
2056
- /([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,
2057
- /\((?:[^()\\]|\\[\s\S])*\)/.source,
2058
- /\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,
2059
- /\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,
2060
- /<(?:[^<>\\]|\\[\s\S])*>/.source
2061
- ].join('|') + ')'),
2062
- greedy: true,
2063
- inside: { 'interpolation': interpolation }
2064
- },
2065
- {
2066
- pattern: /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
2067
- greedy: true,
2068
- inside: { 'interpolation': interpolation }
2069
- },
2070
- {
2071
- pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2072
- alias: 'heredoc-string',
2073
- greedy: true,
2074
- inside: {
2075
- 'delimiter': {
2076
- pattern: /^<<[-~]?[a-z_]\w*|[a-z_]\w*$/i,
2077
- alias: 'symbol',
2078
- inside: { 'punctuation': /^<<[-~]?/ }
2079
- },
2080
- 'interpolation': interpolation
2139
+ Prism.languages.insertBefore('ruby', 'string', {
2140
+ 'string-literal': [
2141
+ {
2142
+ pattern: RegExp(/%[qQiIwWs]?/.source + percentExpression),
2143
+ greedy: true,
2144
+ inside: {
2145
+ 'interpolation': interpolation,
2146
+ 'string': /[\s\S]+/
2147
+ }
2148
+ },
2149
+ {
2150
+ pattern: /("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,
2151
+ greedy: true,
2152
+ inside: {
2153
+ 'interpolation': interpolation,
2154
+ 'string': /[\s\S]+/
2155
+ }
2156
+ },
2157
+ {
2158
+ pattern: /<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2159
+ alias: 'heredoc-string',
2160
+ greedy: true,
2161
+ inside: {
2162
+ 'delimiter': {
2163
+ pattern: /^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,
2164
+ inside: {
2165
+ 'symbol': /\b\w+/,
2166
+ 'punctuation': /^<<[-~]?/
2167
+ }
2168
+ },
2169
+ 'interpolation': interpolation,
2170
+ 'string': /[\s\S]+/
2171
+ }
2172
+ },
2173
+ {
2174
+ pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2175
+ alias: 'heredoc-string',
2176
+ greedy: true,
2177
+ inside: {
2178
+ 'delimiter': {
2179
+ pattern: /^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,
2180
+ inside: {
2181
+ 'symbol': /\b\w+/,
2182
+ 'punctuation': /^<<[-~]?'|'$/
2183
+ }
2184
+ },
2185
+ 'string': /[\s\S]+/
2186
+ }
2081
2187
  }
2082
- },
2083
- {
2084
- pattern: /<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,
2085
- alias: 'heredoc-string',
2086
- greedy: true,
2087
- inside: {
2088
- 'delimiter': {
2089
- pattern: /^<<[-~]?'[a-z_]\w*'|[a-z_]\w*$/i,
2090
- alias: 'symbol',
2091
- inside: { 'punctuation': /^<<[-~]?'|'$/ }
2188
+ ],
2189
+ 'command-literal': [
2190
+ {
2191
+ pattern: RegExp(/%x/.source + percentExpression),
2192
+ greedy: true,
2193
+ inside: {
2194
+ 'interpolation': interpolation,
2195
+ 'command': {
2196
+ pattern: /[\s\S]+/,
2197
+ alias: 'string'
2198
+ }
2199
+ }
2200
+ },
2201
+ {
2202
+ pattern: /`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,
2203
+ greedy: true,
2204
+ inside: {
2205
+ 'interpolation': interpolation,
2206
+ 'command': {
2207
+ pattern: /[\s\S]+/,
2208
+ alias: 'string'
2209
+ }
2092
2210
  }
2093
2211
  }
2094
- }
2095
- ];
2212
+ ]
2213
+ });
2214
+ delete Prism.languages.ruby.string;
2215
+ Prism.languages.insertBefore('ruby', 'number', {
2216
+ 'builtin': /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,
2217
+ 'constant': /\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/
2218
+ });
2096
2219
  Prism.languages.rb = Prism.languages.ruby;
2097
2220
  }(Prism));
2098
2221
  var Prism$1 = prismCore.exports;