(prefixLength int)
| 1525 | } |
| 1526 | |
| 1527 | func (s *Scanner) scanIdentifier(prefixLength int) bool { |
| 1528 | start := s.pos |
| 1529 | s.pos += prefixLength |
| 1530 | ch := s.char() |
| 1531 | // Fast path for simple ASCII identifiers |
| 1532 | if stringutil.IsASCIILetter(ch) || ch == '_' || ch == '$' { |
| 1533 | s.pos++ |
| 1534 | s.scanASCIIWhile(func(b byte) bool { |
| 1535 | return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || (b >= '0' && b <= '9') || b == '_' || b == '$' |
| 1536 | }) |
| 1537 | ch = s.char() |
| 1538 | if ch < utf8.RuneSelf && ch != '\\' { |
| 1539 | s.tokenValue = s.text[start:s.pos] |
| 1540 | return true |
| 1541 | } |
| 1542 | s.pos = start + prefixLength |
| 1543 | } |
| 1544 | ch, size := s.charAndSize() |
| 1545 | if IsIdentifierStart(ch) { |
| 1546 | for { |
| 1547 | s.pos += size |
| 1548 | ch, size = s.charAndSize() |
| 1549 | if !IsIdentifierPart(ch) { |
| 1550 | break |
| 1551 | } |
| 1552 | } |
| 1553 | s.tokenValue = s.text[start:s.pos] |
| 1554 | if ch == '\\' { |
| 1555 | s.tokenValue += s.scanIdentifierParts() |
| 1556 | } |
| 1557 | return true |
| 1558 | } |
| 1559 | return false |
| 1560 | } |
| 1561 | |
| 1562 | func (s *Scanner) scanIdentifierParts() string { |
| 1563 | var sb strings.Builder |
no test coverage detected