| 1830 | dsv.parseRows = function(text, f) { |
| 1831 | var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol; |
| 1832 | function token() { |
| 1833 | if (I >= N) return EOF; |
| 1834 | if (eol) return eol = false, EOL; |
| 1835 | var j = I; |
| 1836 | if (text.charCodeAt(j) === 34) { |
| 1837 | var i = j; |
| 1838 | while (i++ < N) { |
| 1839 | if (text.charCodeAt(i) === 34) { |
| 1840 | if (text.charCodeAt(i + 1) !== 34) break; |
| 1841 | ++i; |
| 1842 | } |
| 1843 | } |
| 1844 | I = i + 2; |
| 1845 | var c = text.charCodeAt(i + 1); |
| 1846 | if (c === 13) { |
| 1847 | eol = true; |
| 1848 | if (text.charCodeAt(i + 2) === 10) ++I; |
| 1849 | } else if (c === 10) { |
| 1850 | eol = true; |
| 1851 | } |
| 1852 | return text.substring(j + 1, i).replace(/""/g, '"'); |
| 1853 | } |
| 1854 | while (I < N) { |
| 1855 | var c = text.charCodeAt(I++), k = 1; |
| 1856 | if (c === 10) eol = true; else if (c === 13) { |
| 1857 | eol = true; |
| 1858 | if (text.charCodeAt(I) === 10) ++I, ++k; |
| 1859 | } else if (c !== delimiterCode) continue; |
| 1860 | return text.substring(j, I - k); |
| 1861 | } |
| 1862 | return text.substring(j); |
| 1863 | } |
| 1864 | while ((t = token()) !== EOF) { |
| 1865 | var a = []; |
| 1866 | while (t !== EOL && t !== EOF) { |