For errors discovered while parsing, insert an error into the ast and update the errors array