Skip to content

Latest commit

 

History

History
1747 lines (1739 loc) · 88.3 KB

LANGUAGES.md

File metadata and controls

1747 lines (1739 loc) · 88.3 KB

List of languages. Pick one you like and open a PR. Make sure you've read CONTRIBUTING.md

You can also request a new language to be added to the list, just leave a comment here.

function comparer(a, b) {
  const re = /(\d+)|(\D+)/g;
  a = a.slice(5).trim();
  b = b.slice(5).trim();
  if (a[0] == '[') a = a.substring(1);
  if (b[0] == '[') b = b.substring(1);
  
  const ax = [], bx = [];
  let an, bn, nn;

  a.replace(re, (_, $1, $2) => ax.push([$1 || Infinity, $2 || ""]));
  b.replace(re, (_, $1, $2) => bx.push([$1 || Infinity, $2 || ""]));
  
  while (ax.length && bx.length) {
    an = ax.shift();
    bn = bx.shift();
    nn = (an[0] - bn[0]) || an[1].localeCompare(bn[1]);
    if(nn) return nn;
  }

  return ax.length - bx.length;
}
copy(a.split('\n').filter((v, i, s) => s.findIndex(e => e.slice(5) == v.slice(5)) === i).sort(comparer).join('\n'))

copy(a.split('\n').filter((v, i, s) => i === s.findIndex(e => e.slice(5).toLowerCase() == v.slice(5).toLowerCase())).sort(comparer).join('\n'));```