Skip to content

Instantly share code, notes, and snippets.

@tarcieri
Created September 12, 2008 07:59
Show Gist options
  • Select an option

  • Save tarcieri/10404 to your computer and use it in GitHub Desktop.

Select an option

Save tarcieri/10404 to your computer and use it in GitHub Desktop.
% Input:
[{module,1,
{constant,1,'Foo'},
[{function,2,
{identifier,2,bar},
[{identifier,2,n}],
[{match,3,
{identifier,3,n},
{op,{'*',3},{identifier,3,n},{integer,3,2}}},
{match,4,
{identifier,4,n},
{op,{'+',4},{identifier,4,n},{integer,4,1}}},
{identifier,5,n}]}]}]
% Output:
[{module,1,
{constant,1,'Foo'},
[{function,2,
{identifier,2,bar},
[{identifier,2,n_0}],
[{match,3,
{identifier,3,n_1},
{op,{'*',3},{identifier,3,n_0},{integer,3,2}}},
{match,4,
{identifier,4,n_2},
{op,{'+',4},{identifier,4,n_1},{integer,4,1}}},
{identifier,5,n_2}]}]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment