Skip to content

Instantly share code, notes, and snippets.

@robphoenix
Created February 12, 2016 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robphoenix/24fec2e0d55b7937a0d5 to your computer and use it in GitHub Desktop.
Save robphoenix/24fec2e0d55b7937a0d5 to your computer and use it in GitHub Desktop.
iex> string = "Hello, <%= 2 + 2 %>!"
"Hello, <%= 2 + 2 %>!"
iex(55)> EEx.compile_string string
{:<>, [context: EEx.Engine, import: Kernel],
 [{:__block__, [],
   [{:=, [],
     [{:tmp1, [], EEx.Engine},
      {:<>, [context: EEx.Engine, import: Kernel], ["", "Hello, "]}]},
    {:<>, [context: EEx.Engine, import: Kernel],
     [{:tmp1, [], EEx.Engine},
      {{:., [],
        [{:__aliases__, [alias: false], [:String, :Chars]}, :to_string]}, [],
       [{:+, [line: 1], [2, 2]}]}]}]}, "!"]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment