Lines Matching defs:sub
904 { "sub", fn_bin_op },
2000 /* Update the substitution "sub" to map "general" to "specific"
2001 * if "specific" is a special case of "general" consistent with "sub",
2006 * Check whether "general" is already assigned something in "sub".
2010 static bool update_sub_base(Substitution &sub, const TupleKindPtr &general,
2015 if (sub.count(name) != 0 && sub.at(name) != specific)
2017 sub.emplace(name, specific);
2021 /* Update the substitution "sub" to map "general" to "specific"
2022 * if "specific" is a special case of "general" consistent with "sub".
2035 static bool update_sub(Substitution &sub, const TupleKindPtr &general,
2041 return update_sub(sub, general->left(), specific->left()) &&
2042 update_sub(sub, general->right(), specific->right());
2048 return update_sub_base(sub, general, specific);
2594 /* Does the string "s" contain "sub" as a substring?
2596 static bool contains(const std::string &s, const std::string &sub)
2598 return s.find(sub) != std::string::npos;
2664 /* If "sub" appears inside "str", then remove the first occurrence and
2668 const std::string &sub)
2671 auto pos = str.find(sub);
2674 res.erase(pos, sub.length());
2679 /* If "sub" appears in "str" next to an underscore, then remove the combination.
2683 const std::string &sub)
2685 auto res = drop_occurrence(str, sub + "_");
2688 return drop_occurrence(res, std::string("_") + sub);