parse: Unify API for err(), fix error

There are two different implementations of the
err() function in parse, one in BaseParser and
one in ResourceSet. This led to a bug where one
was called expecting the API of the other.

This commit fixes that bug, and makes the two
functions have the same basic API.