/* Clears all the errors contained in the parser error stack. Frees all the errors, and the stack that contains'em.  */
static enum CRStatus cr_parser_clear_errors(CRParser *a_this)
/* Clears all the errors contained in the parser error stack. Frees all the errors, and the stack that contains'em.  */
static enum CRStatus cr_parser_clear_errors(CRParser *a_this)
{
        GList *cur = NULL;
        g_return_val_if_fail (a_this && PRIVATE (a_this), CR_BAD_PARAM_ERROR);
        for (cur = PRIVATE (a_this)->err_stack; cur; cur = cur->next) {
                if (cur->data) {
                        cr_parser_error_destroy ((CRParserError *)
                                                 cur->data);
                }
        }
        if (PRIVATE (a_this)->err_stack) {
                g_list_free (PRIVATE (a_this)->err_stack);
                PRIVATE (a_this)->err_stack = NULL;
        }
        return CR_OK;
}