Skip to content

Instantly share code, notes, and snippets.

@josevalim
Created June 24, 2013 12:30
Show Gist options
  • Save josevalim/5849709 to your computer and use it in GitHub Desktop.
Save josevalim/5849709 to your computer and use it in GitHub Desktop.
defp escape({ left, meta, right }) do
{ '{}', meta, [escape(left), meta, escape(right)] }
end
defp escape({ left, right }) do
{ escape(left), escape(right) }
end
defp escape(list) when is_list(list) do
Enum.map(list, escape(&1))
end
defp escape(other) do
other
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment