21 lines
641 B
C++
21 lines
641 B
C++
#include <eqpalg/exp_macro/hold.h>
|
|
#include <sstream>
|
|
std::string replace_hold_macro(std::string&& exp_str) {
|
|
boost::regex base_regex("hold\\(tag(\\d+),(\\d+\\.?\\d*)\\)");
|
|
std::string plv;
|
|
std::stringstream ss;
|
|
ss << "hold$2_on_tag$1_HE";
|
|
plv = ss.str();
|
|
auto ret = boost::regex_replace(exp_str, base_regex, plv);
|
|
return ret;
|
|
}
|
|
std::string replace_hold_dot_macro(std::string&& exp_str){
|
|
boost::regex base_regex("hold(\\d+)(\\.)(\\d+)_on_tag");
|
|
std::string plv;
|
|
std::stringstream ss;
|
|
ss << "hold$1_$3_on_tag";
|
|
plv = ss.str();
|
|
auto ret = boost::regex_replace(exp_str, base_regex, plv);
|
|
return ret;
|
|
}
|