static bool process(std::string& macro)
{
    if (macro == "error")
    {
        return false; // fail the parse
    }

    if (macro == "hello")
    {
        macro = "bye";
    }
    else if (macro == "bye")
    {
        macro = "We meet again";
    }
    else if (macro == "sideeffect")
    {
        std::cerr << "this is a side effect while parsing\n";
        macro = "(done)";
    }
    else if (std::string::npos != macro.find('~'))
    {
        std::reverse(macro.begin(), macro.end());
        macro.erase(std::remove(macro.begin(), macro.end(), '~'));
    }
    else
    {
        macro = std::string("<<") + macro + ">>"; // this makes the unsupported macros appear unchanged
    }

    return true;
}
