Pass parser to function