()
| 281 | } |
| 282 | |
| 283 | nextJSXText(): RawJSXToken { |
| 284 | this.startMarker.index = this.scanner.index; |
| 285 | this.startMarker.line = this.scanner.lineNumber; |
| 286 | this.startMarker.column = this.scanner.index - this.scanner.lineStart; |
| 287 | |
| 288 | const start = this.scanner.index; |
| 289 | |
| 290 | let text = ''; |
| 291 | while (!this.scanner.eof()) { |
| 292 | const ch = this.scanner.source[this.scanner.index]; |
| 293 | if (ch === '{' || ch === '<') { |
| 294 | break; |
| 295 | } |
| 296 | ++this.scanner.index; |
| 297 | text += ch; |
| 298 | if (Character.isLineTerminator(ch.charCodeAt(0))) { |
| 299 | ++this.scanner.lineNumber; |
| 300 | if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') { |
| 301 | ++this.scanner.index; |
| 302 | } |
| 303 | this.scanner.lineStart = this.scanner.index; |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | this.lastMarker.index = this.scanner.index; |
| 308 | this.lastMarker.line = this.scanner.lineNumber; |
| 309 | this.lastMarker.column = this.scanner.index - this.scanner.lineStart; |
| 310 | |
| 311 | const token = { |
| 312 | type: JSXToken.Text, |
| 313 | value: text, |
| 314 | lineNumber: this.scanner.lineNumber, |
| 315 | lineStart: this.scanner.lineStart, |
| 316 | start: start, |
| 317 | end: this.scanner.index |
| 318 | }; |
| 319 | |
| 320 | if ((text.length > 0) && this.config.tokens) { |
| 321 | this.tokens.push(this.convertToken(token as any)); |
| 322 | } |
| 323 | |
| 324 | return token; |
| 325 | } |
| 326 | |
| 327 | peekJSXToken(): RawJSXToken { |
| 328 | const state = this.scanner.saveState(); |
no test coverage detected