Skip to content

Commit

Permalink
[json] Python type annotation.
Browse files Browse the repository at this point in the history
Fixes host-diff

#140
  • Loading branch information
pfusik committed Feb 16, 2024
1 parent 16cdca9 commit 8edec9b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion GenPy.fu
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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");
Expand Down
3 changes: 3 additions & 0 deletions libfut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 3 additions & 0 deletions libfut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23323,6 +23323,9 @@ void WriteTypeAnnotation(FuType type, bool nullable = false)
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");
Expand Down
3 changes: 3 additions & 0 deletions libfut.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 8edec9b

Please sign in to comment.