Skip to content

Instantly share code, notes, and snippets.

@satyr
Created May 20, 2011 01:40
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 satyr/982183 to your computer and use it in GitHub Desktop.
Save satyr/982183 to your computer and use it in GitHub Desktop.
Coco.on \compile ({ast}) -> dig ast
function dig
if it..displayName is \Block and it.lines.0?value is '"use overload"'
it.traverseChildren pick, true
return
it.eachChild dig
function pick
it <<< {compile} if it..displayName is \Op and it.second
void
function compile(o)
"$op('#{@op}', #{ @first .compile o, 2_LIST }
, #{ @second.compile o, 2_LIST })"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment