generates AST for a function definition
changes index to the token after function definition
See Implementation
generates AST for a function definition
changes index to the token after function definition