split type and function definitions from demonstration output