Refine function signature grammar