Add an overload to reuse the same characters for the two parameters of Target::stringInterpolation and use an escaped character sequence
This commit is contained in:
parent
26421597f2
commit
e79a7415de
@ -19,6 +19,7 @@ protected:
|
|||||||
std::stringstream output;
|
std::stringstream output;
|
||||||
INCLUDECOMPONENT(StandardComponents::Define);
|
INCLUDECOMPONENT(StandardComponents::Define);
|
||||||
INCLUDECOMPONENT(StandardComponents::types::String);
|
INCLUDECOMPONENT(StandardComponents::types::String);
|
||||||
|
inline void stringInterpolation(const char* multiline, const string& view) { stringInterpolation(view, multiline, multiline); }
|
||||||
void stringInterpolation(string view, const char* openMultiline = "", const char* closeMultiline = "", const char* concatenationCharacters = "+") {
|
void stringInterpolation(string view, const char* openMultiline = "", const char* closeMultiline = "", const char* concatenationCharacters = "+") {
|
||||||
vector<size_t> interpolationVector;
|
vector<size_t> interpolationVector;
|
||||||
unsigned long occurrence_position = view.find(interpolationString);
|
unsigned long occurrence_position = view.find(interpolationString);
|
||||||
|
@ -7,7 +7,7 @@ struct PyTarget: Target {
|
|||||||
output << parseComponent.name << " = ";
|
output << parseComponent.name << " = ";
|
||||||
}
|
}
|
||||||
void on(const StandardComponents::types::String &parseComponent) override {
|
void on(const StandardComponents::types::String &parseComponent) override {
|
||||||
stringInterpolation(parseComponent.content, "\"\"\"", "\"\"\"");
|
stringInterpolation(R"(""")", parseComponent.content);
|
||||||
}
|
}
|
||||||
using Target::Target;
|
using Target::Target;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user