(
/** @type {CharToken} */ t,
/** @type {boolean} */ insert
)
| 5141 | // leading whitespace when `insert`, returns the non-whitespace remainder |
| 5142 | // token (or null when the token was entirely whitespace). |
| 5143 | const leadingWs = ( |
| 5144 | /** @type {CharToken} */ t, |
| 5145 | /** @type {boolean} */ insert |
| 5146 | ) => { |
| 5147 | const m = /^[\t\n\f\r ]+/.exec(t.data); |
| 5148 | const ws = m ? m[0] : ""; |
| 5149 | if (ws && insert) insertCharacters(ws, t.start, t.start + ws.length); |
| 5150 | if (ws.length === t.data.length) return null; |
| 5151 | return { ...t, data: t.data.slice(ws.length), start: t.start + ws.length }; |
| 5152 | }; |
| 5153 | |
| 5154 | const isAllWs = (/** @type {string} */ s) => { |
| 5155 | for (let i = 0; i < s.length; i++) { |
no test coverage detected