Skip to content

Commit 2497e72

Browse files
authored
Merge pull request #326 from elixirscript/remove_warnings
Remove warnings for FFI modules by adding underscore to args
2 parents d33e276 + 6ba4ec7 commit 2497e72

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

lib/elixir_script/ffi.ex

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,21 @@ defmodule ElixirScript.FFI do
5353
```
5454
"""
5555
defmacro foreign({name, _, args}) do
56+
args = Enum.map(args, fn
57+
{:\\, meta0, [{name, meta, atom}, value]}->
58+
name = String.to_atom("_" <> Atom.to_string(name))
59+
{:\\, meta0, [{name, meta, atom}, value]}
60+
61+
{name, meta, atom} ->
62+
name = String.to_atom("_" <> Atom.to_string(name))
63+
{name, meta, atom}
64+
65+
other ->
66+
other
67+
end)
68+
5669
quote do
5770
def unquote(name)(unquote_splicing(args)), do: nil
5871
end
5972
end
60-
end
73+
end

0 commit comments

Comments
 (0)