parser: add support for parsing function definitions