diff options
author | Piotr Fusik <piotr@fusion-lang.org> | 2024-01-24 12:18:24 +0100 |
---|---|---|
committer | Piotr Fusik <piotr@fusion-lang.org> | 2024-01-24 12:18:24 +0100 |
commit | eb47ff1fe40032f54da5b4d86da000fc384a35af (patch) | |
tree | 816a990f2dd986ab28f936264ee6fad2cf16c144 | |
parent | 05b1dec7f952c4097b2dd9d479e0e843b8ac5aa1 (diff) |
[c] Avoid a space between "*" and "futemp".
-rw-r--r-- | GenC.fu | 6 | ||||
-rw-r--r-- | libfut.cpp | 5 | ||||
-rw-r--r-- | libfut.cs | 5 | ||||
-rw-r--r-- | libfut.hpp | 1 | ||||
-rw-r--r-- | libfut.js | 5 |
5 files changed, 22 insertions, 0 deletions
@@ -134,6 +134,12 @@ public class GenC : GenCCpp && dict.GetValueType() is FuStorageType; } + protected override void StartTemporaryVar!(FuType type) + { + // overridden just to avoid the unnecessary space + StartDefinition(type, true, true); + } + void WriteTemporaryName!(int id) { Write("futemp"); @@ -9079,6 +9079,11 @@ bool GenC::isDictionaryClassStgIndexing(const FuExpr * expr) return (indexing = dynamic_cast<const FuBinaryExpr *>(expr)) && indexing->op == FuToken::leftBracket && (dict = dynamic_cast<const FuClassType *>(indexing->left->type.get())) && dict->class_->typeParameterCount == 2 && dynamic_cast<const FuStorageType *>(dict->getValueType().get()); } +void GenC::startTemporaryVar(const FuType * type) +{ + startDefinition(type, true, true); +} + void GenC::writeTemporaryName(int id) { write("futemp"); @@ -9316,6 +9316,11 @@ namespace Fusion return expr is FuBinaryExpr indexing && indexing.Op == FuToken.LeftBracket && indexing.Left.Type is FuClassType dict && dict.Class.TypeParameterCount == 2 && dict.GetValueType() is FuStorageType; } + protected override void StartTemporaryVar(FuType type) + { + StartDefinition(type, true, true); + } + void WriteTemporaryName(int id) { Write("futemp"); @@ -2033,6 +2033,7 @@ protected: virtual void writePrintfLongPrefix(); void writePrintfWidth(const FuInterpolatedPart * part) override; virtual void writeInterpolatedStringArgBase(const FuExpr * expr); + void startTemporaryVar(const FuType * type) override; void writeInterpolatedStringArg(const FuExpr * expr) override; virtual void writeCamelCaseNotKeyword(std::string_view name); void writeName(const FuSymbol * symbol) override; @@ -9653,6 +9653,11 @@ export class GenC extends GenCCpp return (indexing = expr) instanceof FuBinaryExpr && indexing.op == FuToken.LEFT_BRACKET && (dict = indexing.left.type) instanceof FuClassType && dict.class.typeParameterCount == 2 && dict.getValueType() instanceof FuStorageType; } + startTemporaryVar(type) + { + this.#startDefinition(type, true, true); + } + #writeTemporaryName(id) { this.write("futemp"); |