From 50a47055516cbef71f141576e5a64a65ce54d25c Mon Sep 17 00:00:00 2001 From: PuqiAR Date: Mon, 22 Dec 2025 23:38:20 +0800 Subject: [PATCH] =?UTF-8?q?[Impl]=20=E4=BF=AE=E6=94=B9Double=E7=B1=BB?= =?UTF-8?q?=E5=9E=8BObject=E6=A0=BC=E5=BC=8F=E5=8C=96=E8=BE=93=E5=87=BA=20?= =?UTF-8?q?std::format=20=E4=BB=A3=E6=9B=BF=20std::to=5Fstring.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/value.hpp | 2 +- test.fig | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/include/value.hpp b/include/value.hpp index 5012c92..cce99df 100644 --- a/include/value.hpp +++ b/include/value.hpp @@ -160,7 +160,7 @@ namespace Fig { if (is()) return FString(u8"null"); if (is()) return FString(std::to_string(as())); - if (is()) return FString(std::to_string(as())); + if (is()) return FString(std::format("{}", as())); if (is()) return as(); if (is()) return as() ? FString(u8"true") : FString(u8"false"); if (is()) diff --git a/test.fig b/test.fig index 42b21ec..881c256 100644 --- a/test.fig +++ b/test.fig @@ -1,16 +1,3 @@ -struct Person -{ - name: String; - age: Int; -} +var x := 3.141; -var person := Person{"Fig", 1}; - -const print := __fstdout_println; - -print(person.name, " ", person.age); - -person.name = "hello"; -person.age = 114514; - -print(person.name, " ", person.age); +__fstdout_println(x); \ No newline at end of file