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

Method isWord

src/Lexer.cpp:1067–1081  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Lexer::Type::word [^\s]+

Source from the content-addressed store, hash-verified

1065// Lexer::Type::word
1066// [^\s]+
1067bool Lexer::isWord(std::string& token, Lexer::Type& type) {
1068 std::size_t marker = _cursor;
1069
1070 while (_text[marker] && !unicodeWhitespace(_text[marker]) && !isSingleCharOperator(_text[marker]))
1071 utf8_next_char(_text, marker);
1072
1073 if (marker > _cursor) {
1074 token = _text.substr(_cursor, marker - _cursor);
1075 type = Lexer::Type::word;
1076 _cursor = marker;
1077 return true;
1078 }
1079
1080 return false;
1081}
1082
1083////////////////////////////////////////////////////////////////////////////////
1084bool Lexer::isLiteral(const std::string& literal, bool allowAbbreviations, bool endBoundary) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected