/* Pushes an error on the parser error stack.  */
static enum CRStatus cr_parser_push_error(CRParser *a_this, const guchar *a_msg, enum CRStatus a_status)
/* Pushes an error on the parser error stack.  */
static enum CRStatus cr_parser_push_error(CRParser *a_this, const guchar *a_msg, enum CRStatus a_status)
{
        enum CRStatus status = CR_OK;
        CRParserError *error = NULL;
        CRInputPos pos;
        g_return_val_if_fail (a_this && PRIVATE (a_this)
                              && a_msg, CR_BAD_PARAM_ERROR);
        error = cr_parser_error_new (a_msg, a_status);
        g_return_val_if_fail (error, CR_ERROR);
        RECORD_INITIAL_POS (a_this, &pos);
        cr_parser_error_set_pos
                (error, pos.line, pos.col, pos.next_byte_index - 1);
        PRIVATE (a_this)->err_stack =
                g_list_prepend (PRIVATE (a_this)->err_stack, error);
        if (PRIVATE (a_this)->err_stack == NULL)
                goto error;
        return CR_OK;
      error:
        if (error) {
                cr_parser_error_destroy (error);
                error = NULL;
        }
        return status;
}