summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-matlab.min.js
blob: 14e3ba77d822b549283d9072b557da0c550a4524 (plain)
1
2
3
4
5
6
7
8
9
10
Prism.languages.matlab = {
  comment: [/%\{[\s\S]*?\}%/, /%.+/],
  string: { pattern: /\B'(?:''|[^'\r\n])*'/, greedy: !0 },
  number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?(?:[ij])?|\b[ij]\b/,
  keyword:
    /\b(?:NaN|break|case|catch|continue|else|elseif|end|for|function|if|inf|otherwise|parfor|pause|pi|return|switch|try|while)\b/,
  function: /\b(?!\d)\w+(?=\s*\()/,
  operator: /\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,
  punctuation: /\.{3}|[.,;\[\](){}!]/,
};
al.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
!(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);