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

Method findUUIDs

src/CLI2.cpp:1397–1440  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1395
1396////////////////////////////////////////////////////////////////////////////////
1397void CLI2::findUUIDs() {
1398 bool changes = false;
1399
1400 if (Context::getContext().config.getBoolean("sugar")) {
1401 for (const auto& a : _args) {
1402 if (a._lextype == Lexer::Type::uuid && a.hasTag("FILTER")) {
1403 changes = true;
1404 _uuid_list.push_back(a.attribute("raw"));
1405 }
1406 }
1407
1408 if (!_uuid_list.size()) {
1409 for (auto& a : _args) {
1410 if (a._lextype == Lexer::Type::uuid && a.hasTag("MODIFICATION")) {
1411 changes = true;
1412 a.unTag("MODIFICATION");
1413 a.tag("FILTER");
1414 _uuid_list.push_back(a.attribute("raw"));
1415 }
1416 }
1417 }
1418 }
1419
1420 // Sugar-free.
1421 else {
1422 std::vector<A2> reconstructed;
1423 for (const auto& a : _args) {
1424 if (a.hasTag("FILTER") && a._lextype == Lexer::Type::uuid) {
1425 changes = true;
1426 A2 pair("uuid:" + a.attribute("raw"), Lexer::Type::pair);
1427 pair.tag("FILTER");
1428 pair.decompose();
1429 reconstructed.push_back(pair);
1430 } else
1431 reconstructed.push_back(a);
1432 }
1433
1434 if (changes) _args = reconstructed;
1435 }
1436
1437 if (changes)
1438 if (Context::getContext().config.getInteger("debug.parser") >= 2)
1439 Context::getContext().debug(dump("CLI2::prepareFilter findUUIDs"));
1440}
1441
1442////////////////////////////////////////////////////////////////////////////////
1443void CLI2::insertIDExpr() {

Callers

nothing calls this directly

Calls 6

attributeMethod · 0.80
unTagMethod · 0.80
tagMethod · 0.80
decomposeMethod · 0.80
hasTagMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected