From 0a058a89ecd474917fbedbb427de2d4a8661ece2 Mon Sep 17 00:00:00 2001 From: Cocoa Date: Mon, 10 Jun 2024 11:14:29 +0100 Subject: [PATCH] fix bugs and experimental gleam support --- py_src/module_generator.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/py_src/module_generator.py b/py_src/module_generator.py index effe400e..5e4f9a8c 100644 --- a/py_src/module_generator.py +++ b/py_src/module_generator.py @@ -739,7 +739,8 @@ def _process_function(self, full_qualified_name: str, name: str, func: FuncInfo, if self.module_name == 'Evision': typed_function = f'@external(erlang, "evision", "{module_func_name}")\n' else: - typed_function = f'@external(erlang, "evision_{self.module_name.replace('.', '_').lower()}", "{module_func_name}")\n' + typed_function_module_name = self.module_name.replace('.', '_').lower() + typed_function = f'@external(erlang, "evision_{typed_function_module_name}", "{module_func_name}")\n' if func_arity == 1: if is_instance_method: typed_function += f'pub fn {self.to_gleam_func_name(module_func_name)}1(self: self) -> any\n\n' @@ -801,7 +802,8 @@ def _process_function(self, full_qualified_name: str, name: str, func: FuncInfo, if self.module_name == 'Evision': typed_function = f'@external(erlang, "evision", "{module_func_name}")\n' else: - typed_function = f'@external(erlang, "evision_{self.module_name.replace('.', '_').lower()}", "{module_func_name}")\n' + typed_function_module_name = self.module_name.replace('.', '_').lower() + typed_function = f'@external(erlang, "evision_{typed_function_module_name}", "{module_func_name}")\n' func_name_with_arity = '' if more_than_one_variant and func_args_with_opts: