in src/main/resources/js/prettify.js [306:385]
function r(b) {
var a = [], c = [];
if (b.tripleQuotedStrings)
a
.push( [
"str",
/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
null, "'\"" ]);
else if (b.multiLineStrings)
a
.push( [
"str",
/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,
null, "'\"`" ]);
else
a
.push( [
"str",
/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
null, "\"'" ]);
c.push( [ "pln", /^(?:[^\'\"\`\/\#]+)/, null, " \r\n" ]);
if (b.hashComments)
a.push( [ "com", /^#[^\r\n]*/, null, "#" ]);
if (b.cStyleComments)
c.push( [ "com", /^\/\/[^\r\n]*/, null ]);
if (b.regexLiterals)
c
.push( [
"str",
/^\/(?:[^\\\*\/\[]|\\[\s\S]|\[(?:[^\]\\]|\\.)*(?:\]|$))+(?:\/|$)/,
Y ]);
if (b.cStyleComments)
c.push( [ "com", /^\/\*[\s\S]*?(?:\*\/|$)/, null ]);
var d = x(b.keywords);
b = null;
var g = v(a, c), e = v(
[],
[
[ "pln", /^\s+/, null, " \r\n" ],
[ "pln", /^[a-z_$@][a-z_$@0-9]*/i, null ],
[ "lit", /^0x[a-f0-9]+[a-z]/i, null ],
[
"lit",
/^(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?[a-z]*/i,
null, "123456789" ],
[ "pun", /^[^\s\w\.$@]+/, null ] ]);
function h(f, i) {
for ( var j = 0; j < i.length; j += 2) {
var o = i[j + 1];
if (o === "pln") {
var m, k, l, n;
m = i[j];
k = j + 2 < i.length ? i[j + 2] : f.length;
l = f.substring(m, k);
n = e(l, m);
for ( var p = 0, t = n.length; p < t; p += 2) {
var w = n[p + 1];
if (w === "pln") {
var A = n[p], B = p + 2 < t ? n[p + 2] : l.length, s = f
.substring(A, B);
if (s === ".")
n[p + 1] = "pun";
else if (s in d)
n[p + 1] = "kwd";
else if (/^@?[A-Z][A-Z$]*[a-z][A-Za-z$]*$/.test(s))
n[p + 1] = s.charAt(0) === "@" ? "lit" : "typ"
}
}
u(n, i, j, 2);
j += n.length - 2
}
}
return i
}
return function(f) {
var i = g(f);
i = h(f, i);
return i
}
}