| 1719 | dsv.parseRows = function(text, f) { |
| 1720 | var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol; |
| 1721 | function token() { |
| 1722 | if (I >= N) return EOF; |
| 1723 | if (eol) return eol = false, EOL; |
| 1724 | var j = I; |
| 1725 | if (text.charCodeAt(j) === 34) { |
| 1726 | var i = j; |
| 1727 | while (i++ < N) { |
| 1728 | if (text.charCodeAt(i) === 34) { |
| 1729 | if (text.charCodeAt(i + 1) !== 34) break; |
| 1730 | ++i; |
| 1731 | } |
| 1732 | } |
| 1733 | I = i + 2; |
| 1734 | var c = text.charCodeAt(i + 1); |
| 1735 | if (c === 13) { |
| 1736 | eol = true; |
| 1737 | if (text.charCodeAt(i + 2) === 10) ++I; |
| 1738 | } else if (c === 10) { |
| 1739 | eol = true; |
| 1740 | } |
| 1741 | return text.substring(j + 1, i).replace(/""/g, '"'); |
| 1742 | } |
| 1743 | while (I < N) { |
| 1744 | var c = text.charCodeAt(I++), k = 1; |
| 1745 | if (c === 10) eol = true; else if (c === 13) { |
| 1746 | eol = true; |
| 1747 | if (text.charCodeAt(I) === 10) ++I, ++k; |
| 1748 | } else if (c !== delimiterCode) continue; |
| 1749 | return text.substring(j, I - k); |
| 1750 | } |
| 1751 | return text.substring(j); |
| 1752 | } |
| 1753 | while ((t = token()) !== EOF) { |
| 1754 | var a = []; |
| 1755 | while (t !== EOL && t !== EOF) { |