From a9107fb68d1b3b205c70eb959cc7c559bdcffd7b Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 2 Dec 2021 15:31:16 +0000 Subject: [PATCH] Map functions on 3-tuples --- genbindings.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/genbindings.py b/genbindings.py index d8d00158..c6d672f1 100755 --- a/genbindings.py +++ b/genbindings.py @@ -410,10 +410,14 @@ with open(sys.argv[1]) as in_h, open(f"{sys.argv[2]}/bindings{consts.file_ext}", struct_meth = method_name.rsplit("Z", 1)[0][1:] + "Z" expected_struct = "LDKC" + struct_meth struct_meth_name = method_name[len(struct_meth) + 1:].strip("_") - elif method_name.startswith("C2Tuple"): + elif method_name.startswith("C2Tuple") or method_name.startswith("C3Tuple"): tuple_name = method_name.rsplit("Z", 1)[0][2:] + "Z" - struct_meth = "Two" + tuple_name - expected_struct = "LDKC2" + tuple_name + if method_name.startswith("C2Tuple"): + struct_meth = "Two" + tuple_name + expected_struct = "LDKC2" + tuple_name + else: + struct_meth = "Three" + tuple_name + expected_struct = "LDKC3" + tuple_name struct_meth_name = method_name[len(tuple_name) + 2:].strip("_") else: struct_meth = method_name.split("_")[0] -- 2.39.5