summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Fusik <piotr@fusion-lang.org>2024-02-16 19:21:52 +0100
committerPiotr Fusik <piotr@fusion-lang.org>2024-02-16 19:21:52 +0100
commit8edec9b3596e1c7cb5db551b6da0e3ba1c90bb5e (patch)
tree3b2a0164ca696dac064656d85fd9289e67865124
parent16cdca9616f6c80a60b52b92ac02d4cc3aa39345 (diff)
[json] Python type annotation.
Fixes host-diff #140
-rw-r--r--GenPy.fu5
-rw-r--r--libfut.cpp3
-rw-r--r--libfut.cs3
-rw-r--r--libfut.js3
4 files changed, 13 insertions, 1 deletions
diff --git a/GenPy.fu b/GenPy.fu
index 35f09c3..7f1c05d 100644
--- a/GenPy.fu
+++ b/GenPy.fu
@@ -1,6 +1,6 @@
// GenPy.fu - Python code generator
//
-// Copyright (C) 2020-2023 Piotr Fusik
+// Copyright (C) 2020-2024 Piotr Fusik
//
// This file is part of Fusion Transpiler,
// see https://github.com/fusionlanguage/fut
@@ -340,6 +340,9 @@ public class GenPy : GenPySwift
Include("re");
Write("re.Match");
break;
+ case FuId.JsonElementClass:
+ Write("dict | list | str | float | bool | None");
+ break;
case FuId.LockClass:
Include("threading");
Write("threading.RLock");
diff --git a/libfut.cpp b/libfut.cpp
index 44c4294..d1d7bb8 100644
--- a/libfut.cpp
+++ b/libfut.cpp
@@ -22464,6 +22464,9 @@ void GenPy::writeTypeAnnotation(const FuType * type, bool nullable)
include("re");
write("re.Match");
break;
+ case FuId::jsonElementClass:
+ write("dict | list | str | float | bool | None");
+ break;
case FuId::lockClass:
include("threading");
write("threading.RLock");
diff --git a/libfut.cs b/libfut.cs
index 05feb18..5a3e05e 100644
--- a/libfut.cs
+++ b/libfut.cs
@@ -23323,6 +23323,9 @@ namespace Fusion
Include("re");
Write("re.Match");
break;
+ case FuId.JsonElementClass:
+ Write("dict | list | str | float | bool | None");
+ break;
case FuId.LockClass:
Include("threading");
Write("threading.RLock");
diff --git a/libfut.js b/libfut.js
index 2772e10..c259ebb 100644
--- a/libfut.js
+++ b/libfut.js
@@ -23900,6 +23900,9 @@ export class GenPy extends GenPySwift
this.include("re");
this.write("re.Match");
break;
+ case FuId.JSON_ELEMENT_CLASS:
+ this.write("dict | list | str | float | bool | None");
+ break;
case FuId.LOCK_CLASS:
this.include("threading");
this.write("threading.RLock");