MCPcopy Create free account
hub / github.com/messageformat/messageformat / h

Function h

docs/scripts/prettify/prettify.js:19–43  ·  view source on GitHub ↗
(a)

Source from the content-addressed store, hash-verified

17 }
18
19 function h(a) {
20 for (var f = a.substring(1, a.length - 1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g), a = [], b = [], o = f[0] === "^", c = o ? 1 : 0, i = f.length; c < i; ++c) {
21 var j = f[c];
22 if (/\\[bdsw]/i.test(j)) a.push(j);
23 else {
24 var j = m(j),
25 d;
26 c + 2 < i && "-" === f[c + 1] ? (d = m(f[c + 2]), c += 2) : d = j;
27 b.push([j, d]);
28 d < 65 || j > 122 || (d < 65 || j > 90 || b.push([Math.max(65, j) | 32, Math.min(d, 90) | 32]), d < 97 || j > 122 || b.push([Math.max(97, j) & -33, Math.min(d, 122) & -33]))
29 }
30 }
31 b.sort(function(a, f) {
32 return a[0] - f[0] || f[1] - a[1]
33 });
34 f = [];
35 j = [NaN, NaN];
36 for (c = 0; c < b.length; ++c) i = b[c], i[0] <= j[1] + 1 ? j[1] = Math.max(j[1], i[1]) : f.push(j = i);
37 b = ["["];
38 o && b.push("^");
39 b.push.apply(b, a);
40 for (c = 0; c < f.length; ++c) i = f[c], b.push(e(i[0])), i[1] > i[0] && (i[1] + 1 > i[0] && b.push("-"), b.push(e(i[1])));
41 b.push("]");
42 return b.join("")
43 }
44
45 function y(a) {
46 for (var f = a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g), b = f.length, d = [], c = 0, i = 0; c < b; ++c) {

Callers 2

yFunction · 0.70
eFunction · 0.70

Calls 3

mFunction · 0.70
eFunction · 0.70
bFunction · 0.70

Tested by

no test coverage detected