Convert elixir AST to Erlang AST? Is it possible?

Is it possible to take the quoted Elixir expression (AST tree) as follows:

quote do: 1 + 1
=> {:+, [context: Elixir, import: Kernel], [1, 1]}

And turn it into an Erlang AST?

I looked at the Code module, as well as some Kernel modules that were looking for a function that did this, but I didn't find anything. I’m not even sure that it will be possible ... I don’t know how things like Elixir macros will be presented in Erlang AST.

Thanks in advance!

+4
source share
2 answers

API. elixir, , , API, , .

+5

, "gist", - https://gist.github.com/habibutsu/bc6791d3d81b6ea54e1a

:

fun elixir:'string_to_quoted!'/4
fun elixir:quoted_to_erl/3
-1

All Articles