Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var rantModes = [
  2.     "lower", "upper", "sentence", "word", "title", "none",
  3.     "normal", "roman(?:[-_](?:upper|lower))?", "group(?:[-_](?:commas|dots))?", "verbal[-_]en",
  4.     "locked", "c?deck", "ordered", "reverse",
  5.     "public", "private", "internal",
  6.     "different", "(?:not[-_])?equal", "less", "greater", "none", "one", "all", "any"
  7. ].join("|");
  8.  
  9. var rantFunctions = [
  10.     "[rs](?:ep)?", "n", "num", "after", "alt", "any", "arg", "before", "branch", "b", "break", "capsinfer", "case", "caps",
  11.     "chance", "char", "close", "clrt", "cmp", "define", "dist", "else", "even", "extern", "(?:not)?first", "g", "generation",
  12.     "get", "group", "if[n]?def", "is", "(?:not)?last", "len", "merge", "m", "(?:not)?middle", "nth", "numfmt", "mark", "match",
  13.     "odd", "osend", "out", "repcount", "rc", "repindex", "ri", "repnum", "rn", "send", "src", "step", "undef", "x", "xnew",
  14.     "xnone", "xpin", "xreset", "xseed", "xunpin"
  15.     ].join("|");
  16.  
  17. Prism.languages.rant = {
  18.     'escaped': {
  19.         pattern: /\\((?:\d+,)?(?:[^u\s\r\n]|u[0-9a-f]{4}))/,
  20.         alias: 'punctuation'
  21.     },
  22.     'constliteral': {
  23.         pattern: /(^|[^\\])("(?:(?:[^"]|"")*)?")/,
  24.         alias: 'string',
  25.         lookbehind: true
  26.     },
  27.     'comment': {
  28.         pattern: /#.*/
  29.     },
  30.     'equation': {
  31.         pattern: /(``|`)[\s\S]+?\1/g,
  32.         alias: 'string'
  33.     },
  34.     'query': {
  35.         pattern: /<[\s\S]+?>/g,
  36.         alias: 'tag',
  37.         inside: {
  38.             'regex': /\/\/(.*?[^\\])?\/\/i?/ig
  39.         }
  40.     },
  41.     'regex': {
  42.         pattern: /\/\/(.*?[^\\])?\/\/i?/ig,
  43.         inside: {
  44.             'query': /^$/g
  45.         }
  46.     },
  47.     'function': {
  48.         pattern: new RegExp("((?:^|[^\\\\])\\[)([$]\\w+|" + rantFunctions + ")(?:[:\\]])", "i"),
  49.         lookbehind: true
  50.     },
  51.     'modename': {
  52.         pattern: new RegExp("([:;]\\s*)(" + rantModes + ")\\s*(?=[;\\]])", "i"),
  53.         alias: 'keyword',
  54.         lookbehind: true
  55.     }
  56.     'list': {
  57.         pattern: /((?:^|[^\\])\[)(%[:=!]?\w+)(\s*(?:\+\^?\%?|\=\@?|![@^$]?|\$\^?|\@[?^$]?))?/,
  58.         alias: 'entity',
  59.         lookbehind: true
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement