Commit e37f5852 authored by Radford Neal's avatar Radford Neal

changes to eval to go with show.error.locations + plus identation and error msg chng

parent 3c089448
......@@ -1022,6 +1022,10 @@ SEXP attribute_hidden applyClosure_v(SEXP call, SEXP op, SEXP arglist, SEXP rho,
else
revisecontext (newrho, rho);
/* Get the srcref record from the closure object */
R_Srcref = getAttrib(op, R_SrcrefSymbol);
/* The default return value is NULL. FIXME: Is this really needed
or do we always get a sensible value returned? */
......@@ -2390,13 +2394,17 @@ static SEXP do_eval (SEXP call, SEXP op, SEXP args, SEXP rho, int variant)
}
else if (TYPEOF(expr) == EXPRSXP) {
int i, n;
SEXP srcrefs = getBlockSrcrefs(expr);
n = LENGTH(expr);
tmp = R_NilValue;
begincontext(&cntxt, CTXT_RETURN, call, env, rho, args, op);
if (!SETJMP(cntxt.cjmpbuf))
for (i = 0 ; i < n ; i++)
if (!SETJMP(cntxt.cjmpbuf)) {
for (i = 0 ; i < n ; i++) {
R_Srcref = getSrcref(srcrefs, i);
tmp = evalv (VECTOR_ELT(expr, i), env,
i==n-1 ? variant : VARIANT_NULL | VARIANT_PENDING_OK);
}
}
else {
tmp = R_ReturnedValue;
if (tmp == R_RestartToken) {
......@@ -4541,8 +4549,8 @@ static SEXP bcEval(SEXP body, SEXP rho, Rboolean useCache)
SEXP symbol = VECTOR_ELT(constants, GETOP());
value = findFun(symbol, rho);
if(RTRACE(value)) {
Rprintf("trace: ");
PrintValue(symbol);
Rprintf("trace: ");
PrintValue(symbol);
}
/* initialize the function type register, push the function, and
......@@ -4561,8 +4569,8 @@ static SEXP bcEval(SEXP body, SEXP rho, Rboolean useCache)
SEXP symbol = VECTOR_ELT(constants, GETOP());
value = findFun(symbol, R_GlobalEnv);
if(RTRACE(value)) {
Rprintf("trace: ");
PrintValue(symbol);
Rprintf("trace: ");
PrintValue(symbol);
}
/* initialize the function type register, push the function, and
......@@ -4585,8 +4593,8 @@ static SEXP bcEval(SEXP body, SEXP rho, Rboolean useCache)
SET_NAMEDCNT_MAX(value);
}
if(RTRACE(value)) {
Rprintf("trace: ");
PrintValue(symbol);
Rprintf("trace: ");
PrintValue(symbol);
}
/* initialize the function type register, push the function, and
......@@ -4605,8 +4613,8 @@ static SEXP bcEval(SEXP body, SEXP rho, Rboolean useCache)
SEXP symbol = VECTOR_ELT(constants, GETOP());
value = getPrimitive(symbol, BUILTINSXP);
if (RTRACE(value)) {
Rprintf("trace: ");
PrintValue(symbol);
Rprintf("trace: ");
PrintValue(symbol);
}
/* push the function and push space for creating the argument list. */
......@@ -4624,7 +4632,7 @@ static SEXP bcEval(SEXP body, SEXP rho, Rboolean useCache)
SEXP symbol = VECTOR_ELT(constants, GETOP());
value = INTERNAL(symbol);
if (TYPEOF(value) != BUILTINSXP)
error(_("not a BUILTIN function"));
error(_("no internal function \"%s\""), CHAR(PRINTNAME(symbol)));
/* push the function and push space for creating the argument list. */
ftype = TYPEOF(value);
......@@ -4763,8 +4771,8 @@ static SEXP bcEval(SEXP body, SEXP rho, Rboolean useCache)
int flag;
const void *vmax = VMAXGET();
if (RTRACE(fun)) {
Rprintf("trace: ");
PrintValue(symbol);
Rprintf("trace: ");
PrintValue(symbol);
}
BCNPUSH(fun); /* for GC protection */
flag = PRIMPRINT(fun);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment