2015-05-05 14:15:47 +02:00
|
|
|
std::map<std::string,std::function<mstch::node(const std::string&)>> specs_lambdas {
|
2015-05-04 16:14:32 +02:00
|
|
|
{"Interpolation", [](const std::string&) {
|
2015-05-05 14:15:47 +02:00
|
|
|
return std::string{"world"};
|
2015-05-04 16:14:32 +02:00
|
|
|
}},
|
|
|
|
{"Interpolation - Expansion", [](const std::string&) {
|
2015-05-05 14:15:47 +02:00
|
|
|
return std::string{"{{planet}}"};
|
2015-05-04 16:14:32 +02:00
|
|
|
}},
|
|
|
|
{"Interpolation - Multiple Calls", [](const std::string&) {
|
2015-05-05 14:15:47 +02:00
|
|
|
static int calls = 0; return ++calls;
|
2015-05-04 16:14:32 +02:00
|
|
|
}},
|
|
|
|
{"Escaping", [](const std::string&) {
|
2015-05-05 14:15:47 +02:00
|
|
|
return std::string{">"};
|
2015-05-04 16:14:32 +02:00
|
|
|
}},
|
|
|
|
{"Section", [](const std::string& txt) {
|
2015-05-05 14:15:47 +02:00
|
|
|
return std::string{(txt == "{{x}}") ? "yes" : "no"};
|
2015-05-04 16:14:32 +02:00
|
|
|
}},
|
|
|
|
{"Section - Expansion", [](const std::string& txt) {
|
2015-05-05 14:15:47 +02:00
|
|
|
return txt + std::string{"{{planet}}"} + txt;
|
2015-05-04 16:14:32 +02:00
|
|
|
}},
|
|
|
|
{"Section - Multiple Calls", [](const std::string& txt) {
|
|
|
|
return "__" + txt + "__";
|
|
|
|
}},
|
|
|
|
{"Inverted Section", [](const std::string& txt) {
|
2015-05-05 14:15:47 +02:00
|
|
|
return false;
|
2015-05-04 16:14:32 +02:00
|
|
|
}}
|
|
|
|
};
|