aboutsummaryrefslogtreecommitdiffstats
path: root/public/prism/prism-icu-message-format.min.js
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-30 19:47:21 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-30 19:47:21 +0100
commita98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 (patch)
tree542810ab5aef99150db228bb54fd58303dcb31c7 /public/prism/prism-icu-message-format.min.js
parentab355897a12b7bda1089a44de326d41455a0f7a3 (diff)
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-icu-message-format.min.js')
-rw-r--r--public/prism/prism-icu-message-format.min.js112
1 files changed, 112 insertions, 0 deletions
diff --git a/public/prism/prism-icu-message-format.min.js b/public/prism/prism-icu-message-format.min.js
new file mode 100644
index 0000000..f6aa19c
--- /dev/null
+++ b/public/prism/prism-icu-message-format.min.js
@@ -0,0 +1,112 @@
+!(function (e) {
+ function s(e, t) {
+ return t <= 0
+ ? '[]'
+ : e.replace(/<SELF>/g, function () {
+ return s(e, t - 1);
+ });
+ }
+ var t = /'[{}:=,](?:[^']|'')*'(?!')/,
+ n = { pattern: /''/, greedy: !0, alias: 'operator' },
+ r = { pattern: t, greedy: !0, inside: { escape: n } },
+ a = s(
+ "\\{(?:[^{}']|'(?![{},'])|''|<STR>|<SELF>)*\\}".replace(
+ /<STR>/g,
+ function () {
+ return t.source;
+ }
+ ),
+ 8
+ ),
+ i = {
+ pattern: RegExp(a),
+ inside: {
+ message: {
+ pattern: /^(\{)[\s\S]+(?=\}$)/,
+ lookbehind: !0,
+ inside: null,
+ },
+ 'message-delimiter': { pattern: /./, alias: 'punctuation' },
+ },
+ };
+ (e.languages['icu-message-format'] = {
+ argument: {
+ pattern: RegExp(a),
+ greedy: !0,
+ inside: {
+ content: {
+ pattern: /^(\{)[\s\S]+(?=\}$)/,
+ lookbehind: !0,
+ inside: {
+ 'argument-name': { pattern: /^(\s*)[^{}:=,\s]+/, lookbehind: !0 },
+ 'choice-style': {
+ pattern: /^(\s*,\s*choice\s*,\s*)\S(?:[\s\S]*\S)?/,
+ lookbehind: !0,
+ inside: {
+ punctuation: /\|/,
+ range: {
+ pattern: /^(\s*)[+-]?(?:\d+(?:\.\d*)?|\u221e)\s*[<#\u2264]/,
+ lookbehind: !0,
+ inside: { operator: /[<#\u2264]/, number: /\S+/ },
+ },
+ rest: null,
+ },
+ },
+ 'plural-style': {
+ pattern:
+ /^(\s*,\s*(?:plural|selectordinal)\s*,\s*)\S(?:[\s\S]*\S)?/,
+ lookbehind: !0,
+ inside: {
+ offset: /^offset:\s*\d+/,
+ 'nested-message': i,
+ selector: {
+ pattern: /=\d+|[^{}:=,\s]+/,
+ inside: { keyword: /^(?:few|many|one|other|two|zero)$/ },
+ },
+ },
+ },
+ 'select-style': {
+ pattern: /^(\s*,\s*select\s*,\s*)\S(?:[\s\S]*\S)?/,
+ lookbehind: !0,
+ inside: {
+ 'nested-message': i,
+ selector: {
+ pattern: /[^{}:=,\s]+/,
+ inside: { keyword: /^other$/ },
+ },
+ },
+ },
+ keyword: /\b(?:choice|plural|select|selectordinal)\b/,
+ 'arg-type': {
+ pattern: /\b(?:date|duration|number|ordinal|spellout|time)\b/,
+ alias: 'keyword',
+ },
+ 'arg-skeleton': { pattern: /(,\s*)::[^{}:=,\s]+/, lookbehind: !0 },
+ 'arg-style': {
+ pattern:
+ /(,\s*)(?:currency|full|integer|long|medium|percent|short)(?=\s*$)/,
+ lookbehind: !0,
+ },
+ 'arg-style-text': {
+ pattern: RegExp(
+ '(^\\s*,\\s*(?=\\S))' +
+ s("(?:[^{}']|'[^']*'|\\{(?:<SELF>)?\\})+", 8) +
+ '$'
+ ),
+ lookbehind: !0,
+ alias: 'string',
+ },
+ punctuation: /,/,
+ },
+ },
+ 'argument-delimiter': { pattern: /./, alias: 'operator' },
+ },
+ },
+ escape: n,
+ string: r,
+ }),
+ (i.inside.message.inside = e.languages['icu-message-format']),
+ (e.languages['icu-message-format'].argument.inside.content.inside[
+ 'choice-style'
+ ].inside.rest = e.languages['icu-message-format']);
+})(Prism);