summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaelan Sayler <git@caesay.com>2024-02-22 13:33:20 +0000
committerPiotr Fusik <piotr@fusion-lang.org>2024-02-22 14:37:24 +0100
commitb297cb9886b2b37bb10c5835737f1f42d4d9ffb9 (patch)
tree37b65eb521e40c017bec1a7ac58554f5639b63e1
parentb02b77f6ed164500754c3f794826bc4a32097253 (diff)
Fix name of FuString_Replace
-rw-r--r--GenCpp.fu4
-rw-r--r--libfut.cpp12
-rw-r--r--libfut.cs4
-rw-r--r--libfut.js4
4 files changed, 12 insertions, 12 deletions
diff --git a/GenCpp.fu b/GenCpp.fu
index 85d311a..fb75065 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 9c46fb2..3f67cf6 100644
--- a/libfut.cpp
+++ b/libfut.cpp
@@ -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());
@@ -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;
@@ -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;
@@ -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;
}
@@ -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 1e04977..13b15a1 100644
--- a/libfut.cs
+++ b/libfut.cs
@@ -14130,7 +14130,7 @@ namespace Fusion
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 @@ namespace Fusion
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 0ff6932..175879a 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());");