/////////////////////////////////////////////////////////////////////////// Lexer::Type::url http [s] :// ...
| 603 | // Lexer::Type::url |
| 604 | // http [s] :// ... |
| 605 | bool Lexer::isURL(std::string& token, Lexer::Type& type) { |
| 606 | std::size_t marker = _cursor; |
| 607 | |
| 608 | if (_eos - _cursor > 9 && // length 'https://*' |
| 609 | (_text[marker + 0] == 'h' || _text[marker + 0] == 'H') && |
| 610 | (_text[marker + 1] == 't' || _text[marker + 1] == 'T') && |
| 611 | (_text[marker + 2] == 't' || _text[marker + 2] == 'T') && |
| 612 | (_text[marker + 3] == 'p' || _text[marker + 3] == 'P')) { |
| 613 | marker += 4; |
| 614 | if (_text[marker + 0] == 's' || _text[marker + 0] == 'S') ++marker; |
| 615 | |
| 616 | if (_text[marker + 0] == ':' && _text[marker + 1] == '/' && _text[marker + 2] == '/') { |
| 617 | marker += 3; |
| 618 | |
| 619 | while (marker < _eos && !unicodeWhitespace(_text[marker])) utf8_next_char(_text, marker); |
| 620 | |
| 621 | token = _text.substr(_cursor, marker - _cursor); |
| 622 | type = Lexer::Type::url; |
| 623 | _cursor = marker; |
| 624 | return true; |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | return false; |
| 629 | } |
| 630 | |
| 631 | //////////////////////////////////////////////////////////////////////////////// |
| 632 | // Lexer::Type::pair |
nothing calls this directly
no outgoing calls
no test coverage detected