Skip to content

Commit

Permalink
fix bugs and experimental gleam support
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-xu committed Jun 10, 2024
1 parent eded7b4 commit 0a058a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions py_src/module_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0a058a8

Please sign in to comment.