diff --git a/GenCpp.fu b/GenCpp.fu index 85d311a1..fb75065f 100644 --- a/GenCpp.fu +++ b/GenCpp.fu @@ -809,7 +809,7 @@ public class GenCpp : GenCCpp break; case FuId.StringReplace: this.StringReplace = true; - WriteCall("FuString_replace", obj, args[0], args[1]); + WriteCall("FuString_Replace", obj, args[0], args[1]); break; case FuId.StringStartsWith: WriteStringMethod(obj, "starts_with", method, args); @@ -1983,7 +1983,7 @@ public class GenCpp : GenCCpp WriteLine("using namespace std::string_view_literals;"); if (this.StringReplace) { WriteNewLine(); - WriteLine("static std::string FuString_replace(std::string_view s, std::string_view oldValue, std::string_view newValue)"); + WriteLine("static std::string FuString_Replace(std::string_view s, std::string_view oldValue, std::string_view newValue)"); OpenBlock(); WriteLine("std::string result;"); WriteLine("result.reserve(s.size());"); diff --git a/libfut.cpp b/libfut.cpp index 9c46fb2b..3f67cf66 100644 --- a/libfut.cpp +++ b/libfut.cpp @@ -6,7 +6,7 @@ #include #include "libfut.hpp" -static std::string FuString_replace(std::string_view s, std::string_view oldValue, std::string_view newValue) +static std::string FuString_Replace(std::string_view s, std::string_view oldValue, std::string_view newValue) { std::string result; result.reserve(s.size()); @@ -2932,7 +2932,7 @@ void FuParser::checkXcrementParent() std::shared_ptr FuParser::parseDouble() { double d; - if (![&] { char *ciend; d = std::strtod(FuString_replace(getLexeme(), "_", "").data(), &ciend); return *ciend == '\0'; }()) + if (![&] { char *ciend; d = std::strtod(FuString_Replace(getLexeme(), "_", "").data(), &ciend); return *ciend == '\0'; }()) reportError("Invalid floating-point number"); std::shared_ptr result = std::make_shared(); result->line = this->line; @@ -2953,7 +2953,7 @@ std::shared_ptr FuParser::parseInterpolatedString() std::shared_ptr result = std::make_shared(); result->line = this->line; do { - std::string prefix{FuString_replace(this->stringValue, "{{", "{")}; + std::string prefix{FuString_Replace(this->stringValue, "{{", "{")}; nextToken(); std::shared_ptr arg = parseExpr(); std::shared_ptr width = eat(FuToken::comma) ? parseExpr() : nullptr; @@ -2972,7 +2972,7 @@ std::shared_ptr FuParser::parseInterpolatedString() check(FuToken::rightBrace); } while (readString(true) == FuToken::interpolatedString); - result->suffix = FuString_replace(this->stringValue, "{{", "{"); + result->suffix = FuString_Replace(this->stringValue, "{{", "{"); nextToken(); return result; } @@ -13780,7 +13780,7 @@ void GenCpp::writeCallExpr(const FuExpr * obj, const FuMethod * method, const st break; case FuId::stringReplace: this->stringReplace = true; - writeCall("FuString_replace", obj, (*args)[0].get(), (*args)[1].get()); + writeCall("FuString_Replace", obj, (*args)[0].get(), (*args)[1].get()); break; case FuId::stringStartsWith: writeStringMethod(obj, "starts_with", method, args); @@ -14936,7 +14936,7 @@ void GenCpp::writeProgram(const FuProgram * program) writeLine("using namespace std::string_view_literals;"); if (this->stringReplace) { writeNewLine(); - writeLine("static std::string FuString_replace(std::string_view s, std::string_view oldValue, std::string_view newValue)"); + writeLine("static std::string FuString_Replace(std::string_view s, std::string_view oldValue, std::string_view newValue)"); openBlock(); writeLine("std::string result;"); writeLine("result.reserve(s.size());"); diff --git a/libfut.cs b/libfut.cs index 1e049770..13b15a16 100644 --- a/libfut.cs +++ b/libfut.cs @@ -14130,7 +14130,7 @@ protected override void WriteCallExpr(FuExpr obj, FuMethod method, List break; case FuId.StringReplace: this.StringReplace = true; - WriteCall("FuString_replace", obj, args[0], args[1]); + WriteCall("FuString_Replace", obj, args[0], args[1]); break; case FuId.StringStartsWith: WriteStringMethod(obj, "starts_with", method, args); @@ -15286,7 +15286,7 @@ public override void WriteProgram(FuProgram program) WriteLine("using namespace std::string_view_literals;"); if (this.StringReplace) { WriteNewLine(); - WriteLine("static std::string FuString_replace(std::string_view s, std::string_view oldValue, std::string_view newValue)"); + WriteLine("static std::string FuString_Replace(std::string_view s, std::string_view oldValue, std::string_view newValue)"); OpenBlock(); WriteLine("std::string result;"); WriteLine("result.reserve(s.size());"); diff --git a/libfut.js b/libfut.js index 0ff69321..175879a8 100644 --- a/libfut.js +++ b/libfut.js @@ -14562,7 +14562,7 @@ export class GenCpp extends GenCCpp break; case FuId.STRING_REPLACE: this.#stringReplace = true; - this.writeCall("FuString_replace", obj, args[0], args[1]); + this.writeCall("FuString_Replace", obj, args[0], args[1]); break; case FuId.STRING_STARTS_WITH: this.#writeStringMethod(obj, "starts_with", method, args); @@ -15733,7 +15733,7 @@ export class GenCpp extends GenCCpp this.writeLine("using namespace std::string_view_literals;"); if (this.#stringReplace) { this.writeNewLine(); - this.writeLine("static std::string FuString_replace(std::string_view s, std::string_view oldValue, std::string_view newValue)"); + this.writeLine("static std::string FuString_Replace(std::string_view s, std::string_view oldValue, std::string_view newValue)"); this.openBlock(); this.writeLine("std::string result;"); this.writeLine("result.reserve(s.size());");