Skip to content

Commit

Permalink
Fix name of FuString_Replace
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay authored and pfusik committed Feb 22, 2024
1 parent b02b77f commit b297cb9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions GenCpp.fu
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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());");
Expand Down
12 changes: 6 additions & 6 deletions libfut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <format>
#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());
Expand Down Expand Up @@ -2932,7 +2932,7 @@ void FuParser::checkXcrementParent()
std::shared_ptr<FuLiteralDouble> 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<FuLiteralDouble> result = std::make_shared<FuLiteralDouble>();
result->line = this->line;
Expand All @@ -2953,7 +2953,7 @@ std::shared_ptr<FuInterpolatedString> FuParser::parseInterpolatedString()
std::shared_ptr<FuInterpolatedString> result = std::make_shared<FuInterpolatedString>();
result->line = this->line;
do {
std::string prefix{FuString_replace(this->stringValue, "{{", "{")};
std::string prefix{FuString_Replace(this->stringValue, "{{", "{")};
nextToken();
std::shared_ptr<FuExpr> arg = parseExpr();
std::shared_ptr<FuExpr> width = eat(FuToken::comma) ? parseExpr() : nullptr;
Expand All @@ -2972,7 +2972,7 @@ std::shared_ptr<FuInterpolatedString> 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;
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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());");
Expand Down
4 changes: 2 additions & 2 deletions libfut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14130,7 +14130,7 @@ protected override void WriteCallExpr(FuExpr obj, FuMethod method, List<FuExpr>
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);
Expand Down Expand Up @@ -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());");
Expand Down
4 changes: 2 additions & 2 deletions libfut.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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());");
Expand Down

0 comments on commit b297cb9

Please sign in to comment.