()
| 4385 | } |
| 4386 | |
| 4387 | function advance() { |
| 4388 | var ch |
| 4389 | |
| 4390 | if (!state.inJSXChild) { |
| 4391 | skipComment() |
| 4392 | } |
| 4393 | |
| 4394 | if (index >= length) { |
| 4395 | return { |
| 4396 | type: Token.EOF, |
| 4397 | lineNumber: lineNumber, |
| 4398 | lineStart: lineStart, |
| 4399 | range: [index, index] |
| 4400 | } |
| 4401 | } |
| 4402 | |
| 4403 | if (state.inJSXChild) { |
| 4404 | return advanceJSXChild() |
| 4405 | } |
| 4406 | |
| 4407 | ch = source.charCodeAt(index) |
| 4408 | |
| 4409 | // Very common: ( and ) and ; |
| 4410 | if (ch === 40 || ch === 41 || ch === 58) { |
| 4411 | return scanPunctuator() |
| 4412 | } |
| 4413 | |
| 4414 | // String literal starts with single quote (#39) or double quote (#34). |
| 4415 | if (ch === 39 || ch === 34) { |
| 4416 | if (state.inJSXTag) { |
| 4417 | return scanJSXStringLiteral() |
| 4418 | } |
| 4419 | return scanStringLiteral() |
| 4420 | } |
| 4421 | |
| 4422 | if (state.inJSXTag && isJSXIdentifierStart(ch)) { |
| 4423 | return scanJSXIdentifier() |
| 4424 | } |
| 4425 | |
| 4426 | if (ch === 96) { |
| 4427 | return scanTemplate() |
| 4428 | } |
| 4429 | if (isIdentifierStart(ch)) { |
| 4430 | return scanIdentifier() |
| 4431 | } |
| 4432 | |
| 4433 | // Dot (.) char #46 can also start a floating-point number, hence the need |
| 4434 | // to check the next character. |
| 4435 | if (ch === 46) { |
| 4436 | if (isDecimalDigit(source.charCodeAt(index + 1))) { |
| 4437 | return scanNumericLiteral() |
| 4438 | } |
| 4439 | return scanPunctuator() |
| 4440 | } |
| 4441 | |
| 4442 | if (isDecimalDigit(ch)) { |
| 4443 | return scanNumericLiteral() |
| 4444 | } |
no test coverage detected
searching dependent graphs…