added function codegen

test plan: node parsetest.js