MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / isHexNumber

Method isHexNumber

src/Lexer.cpp:482–499  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Lexer::Type::hex 0xX+

Source from the content-addressed store, hash-verified

480// Lexer::Type::hex
481// 0xX+
482bool Lexer::isHexNumber(std::string& token, Lexer::Type& type) {
483 std::size_t marker = _cursor;
484
485 if (_eos - marker >= 3 && _text[marker + 0] == '0' && _text[marker + 1] == 'x') {
486 marker += 2;
487
488 while (unicodeHexDigit(_text[marker])) ++marker;
489
490 if (marker - _cursor > 2) {
491 token = _text.substr(_cursor, marker - _cursor);
492 type = Lexer::Type::hex;
493 _cursor = marker;
494 return true;
495 }
496 }
497
498 return false;
499}
500
501////////////////////////////////////////////////////////////////////////////////
502// Lexer::Type::number

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected