MCPcopy Create free account
hub / github.com/codemix/htmling / cleanupExpected

Function cleanupExpected

lib/parser.js:928–948  ·  view source on GitHub ↗
(expected)

Source from the content-addressed store, hash-verified

926
927 function peg$buildException(message, expected, pos) {
928 function cleanupExpected(expected) {
929 var i = 1;
930
931 expected.sort(function(a, b) {
932 if (a.description < b.description) {
933 return -1;
934 } else if (a.description > b.description) {
935 return 1;
936 } else {
937 return 0;
938 }
939 });
940
941 while (i < expected.length) {
942 if (expected[i - 1] === expected[i]) {
943 expected.splice(i, 1);
944 } else {
945 i++;
946 }
947 }
948 }
949
950 function buildMessage(expected, found) {
951 function stringEscape(s) {

Callers 1

peg$buildExceptionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…