summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-bro.min.js
blob: 3c550b33e28605ff4bc5f6a2514ba5c9153d713c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Prism.languages.bro = {
  comment: {
    pattern: /(^|[^\\$])#.*/,
    lookbehind: !0,
    inside: { italic: /\b(?:FIXME|TODO|XXX)\b/ },
  },
  string: {
    pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
    greedy: !0,
  },
  boolean: /\b[TF]\b/,
  function: {
    pattern: /(\b(?:event|function|hook)[ \t]+)\w+(?:::\w+)?/,
    lookbehind: !0,
  },
  builtin:
    /(?:@(?:load(?:-(?:plugin|sigs))?|unload|prefixes|ifn?def|else|(?:end)?if|DIR|FILENAME))|(?:&?(?:add_func|create_expire|default|delete_func|encrypt|error_handler|expire_func|group|log|mergeable|optional|persistent|priority|raw_output|read_expire|redef|rotate_interval|rotate_size|synchronized|type_column|write_expire))/,
  constant: { pattern: /(\bconst[ \t]+)\w+/i, lookbehind: !0 },
  keyword:
    /\b(?:add|addr|alarm|any|bool|break|const|continue|count|delete|double|else|enum|event|export|file|for|function|global|hook|if|in|int|interval|local|module|next|of|opaque|pattern|port|print|record|return|schedule|set|string|subnet|table|time|timeout|using|vector|when)\b/,
  operator: /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,
  number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
  punctuation: /[{}[\];(),.:]/,
};
span> + e + ')'; }); return e .replace(/<self>/g, '[^\\s\\S]') .replace( /<str>/g, '(?:@(?!")|"(?:[^\r\n\\\\"]|\\\\.)*"|@"(?:[^\\\\"]|""|\\\\[^])*"(?!")|' + "'(?:(?:[^\r\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'|(?=[^\\\\](?!'))))" ) .replace( /<comment>/g, '(?:/(?![/*])|//.*[\r\n]|/\\*[^*]*(?:\\*(?!/)[^*]*)*\\*/)' ); } var a = s('\\((?:[^()\'"@/]|<str>|<comment>|<self>)*\\)', 2), r = s('\\[(?:[^\\[\\]\'"@/]|<str>|<comment>|<self>)*\\]', 2), t = s('\\{(?:[^{}\'"@/]|<str>|<comment>|<self>)*\\}', 2), n = s('<(?:[^<>\'"@/]|<str>|<comment>|<self>)*>', 2), l = '(?:\\s(?:\\s*[^\\s>/=]+(?:\\s*=\\s*(?:"[^"]*"|\'[^\']*\'|[^\\s\'">=]+(?=[\\s>]))|(?=[\\s/>])))+)?', i = '(?!\\d)[^\\s>/=$<%]+' + l + '\\s*/?>', o = '\\B@?(?:<([a-zA-Z][\\w:]*)' + l + '\\s*>(?:[^<]|</?(?!\\1\\b)' + i + '|' + s( '<\\1' + l + '\\s*>(?:[^<]|</?(?!\\1\\b)' + i + '|<self>)*</\\1\\s*>', 2 ) + ')*</\\1\\s*>|<' + i + ')'; e.languages.cshtml = e.languages.extend('markup', {}); var g = { pattern: /\S[\s\S]*/, alias: 'language-csharp', inside: e.languages.insertBefore( 'csharp', 'string', { html: { pattern: RegExp(o), greedy: !0, inside: e.languages.cshtml } }, { csharp: e.languages.extend('csharp', {}) } ), }; e.languages.insertBefore('cshtml', 'prolog', { 'razor-comment': { pattern: /@\*[\s\S]*?\*@/, greedy: !0, alias: 'comment', }, block: { pattern: RegExp( '(^|[^@])@(?:' + [ t, '(?:code|functions)\\s*' + t, '(?:for|foreach|lock|switch|using|while)\\s*' + a + '\\s*' + t, 'do\\s*' + t + '\\s*while\\s*' + a + '(?:\\s*;)?', 'try\\s*' + t + '\\s*catch\\s*' + a + '\\s*' + t + '\\s*finally\\s*' + t, 'if\\s*' + a + '\\s*' + t + '(?:\\s*else(?:\\s+if\\s*' + a + ')?\\s*' + t + ')*', ].join('|') + ')' ), lookbehind: !0, greedy: !0, inside: { keyword: /^@\w*/, csharp: g }, }, directive: { pattern: /^([ \t]*)@(?:addTagHelper|attribute|implements|inherits|inject|layout|model|namespace|page|preservewhitespace|removeTagHelper|section|tagHelperPrefix|using)(?=\s).*/m, lookbehind: !0, greedy: !0, inside: { keyword: /^@\w+/, csharp: g }, }, value: { pattern: RegExp( '(^|[^@])@(?:await\\b\\s*)?(?:\\w+\\b|' + a + ')(?:[?!]?\\.\\w+\\b|' + a + '|' + r + '|' + n + a + ')*' ), lookbehind: !0, greedy: !0, alias: 'variable', inside: { keyword: /^@/, csharp: g }, }, 'delegate-operator': { pattern: /(^|[^@])@(?=<)/, lookbehind: !0, alias: 'operator', }, }), (e.languages.razor = e.languages.cshtml); })(Prism);