The R Project SVN R

Rev

Rev 89924 | Rev 90254 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 89924 Rev 89935
Line 1... Line 1...
1
/*
1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 1995--2025  The R Core Team.
3
 *  Copyright (C) 1995--2026  The R Core Team.
4
 *
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
8
 *  (at your option) any later version.
Line 2780... Line 2780...
2780
{
2780
{
2781
    if (call == R_CurrentExpression) /* as error() */
2781
    if (call == R_CurrentExpression) /* as error() */
2782
	call = getCurrentCall();
2782
	call = getCurrentCall();
2783
    PROTECT(call);
2783
    PROTECT(call);
2784
    SEXP cond;
2784
    SEXP cond;
-
 
2785
    Rboolean non_empty_arg = arg[0] != 0;
2785
    if(*arg)
2786
    if(non_empty_arg)
2786
	cond = R_makeErrorCondition(call, "missingArgError", subclass, 0,
2787
	cond = R_makeErrorCondition(call, "missingArgError", subclass, 1,
2787
				    _("argument \"%s\" is missing, with no default"), arg);
2788
				    _("argument \"%s\" is missing, with no default"), arg);
2788
    else
2789
    else
2789
	cond = R_makeErrorCondition(call, "missingArgError", subclass, 0,
2790
	cond = R_makeErrorCondition(call, "missingArgError", subclass, 1,
2790
				    _("argument is missing, with no default"));
2791
				    _("argument is missing, with no default"));
2791
    PROTECT(cond);
2792
    PROTECT(cond);
-
 
2793
    if (non_empty_arg)
-
 
2794
	R_setConditionField(cond, 2, "name", install(arg));
-
 
2795
    else
-
 
2796
	R_setConditionField(cond, 2, "name", R_NilValue);
2792
    R_signalErrorCondition(cond, call);
2797
    R_signalErrorCondition(cond, call);
2793
    UNPROTECT(2); /* not reached */
2798
    UNPROTECT(2); /* not reached */
2794
}
2799
}
2795
 
2800
 
2796
NORET void R_MissingArgError(SEXP symbol, SEXP call, const char* subclass)
2801
NORET void R_MissingArgError(SEXP symbol, SEXP call, const char* subclass)