Simplify the code for parseDeclaration.

This is to help get to a point where we can remove the direct call to 'error' within it.