MCPcopy
hub / github.com/microsoft/SandDance / token

Function token

docs/tests/v2/es6/js/sanddance.js:77813–77842  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77811 if (text.charCodeAt(N - 1) === RETURN) --N;
77812
77813 function token() {
77814 if (eof) return EOF;
77815 if (eol) return eol = false, EOL; // Unescape quotes.
77816
77817 var i,
77818 j = I,
77819 c;
77820
77821 if (text.charCodeAt(j) === QUOTE) {
77822 while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);
77823
77824 if ((i = I) >= N) eof = true;else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;else if (c === RETURN) {
77825 eol = true;
77826 if (text.charCodeAt(I) === NEWLINE) ++I;
77827 }
77828 return text.slice(j + 1, i - 1).replace(/""/g, "\"");
77829 } // Find next delimiter or newline.
77830
77831
77832 while (I < N) {
77833 if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;else if (c === RETURN) {
77834 eol = true;
77835 if (text.charCodeAt(I) === NEWLINE) ++I;
77836 } else if (c !== DELIMITER) continue;
77837 return text.slice(j, i);
77838 } // Return last token before EOF.
77839
77840
77841 return eof = true, text.slice(j, N);
77842 }
77843
77844 while ((t = token()) !== EOF) {
77845 var row = [];

Callers 1

parseRowsFunction · 0.70

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected