The R Project SVN R

Rev

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

Rev 5731 Rev 6098
Line 23... Line 23...
23
 
23
 
24
#include "Defn.h"
24
#include "Defn.h"
25
 
25
 
26
SEXP do_debug(SEXP call, SEXP op, SEXP args, SEXP rho)
26
SEXP do_debug(SEXP call, SEXP op, SEXP args, SEXP rho)
27
{
27
{
28
    SEXP s;
-
 
29
    checkArity(op,args);
28
    checkArity(op,args);
-
 
29
#define find_char_fun \
30
    if (TYPEOF(CAR(args)) == STRSXP) {
30
    if (isValidString(CAR(args))) {				\
-
 
31
	SEXP s;							\
31
	PROTECT(s = install(CHAR(STRING(CAR(args))[0])));
32
	PROTECT(s = install(CHAR(STRING(CAR(args))[0])));	\
32
	CAR(args )= findFun(s, rho);
33
	CAR(args) = findFun(s, rho);				\
33
	UNPROTECT(1);
34
	UNPROTECT(1);						\
34
    }
35
    }
-
 
36
    find_char_fun
-
 
37
 
35
    if (TYPEOF(CAR(args)) != CLOSXP)
38
    if (TYPEOF(CAR(args)) != CLOSXP)
36
	errorcall(call, "argument must be a function");
39
	errorcall(call, "argument must be a function");
37
    switch(PRIMVAL(op)) {
40
    switch(PRIMVAL(op)) {
38
    case 0:
41
    case 0:
39
	DEBUG(CAR(args)) = 1;
42
	DEBUG(CAR(args)) = 1;
Line 45... Line 48...
45
	break;
48
	break;
46
    }
49
    }
47
    return R_NilValue;
50
    return R_NilValue;
48
}
51
}
49
 
52
 
50
SEXP do_trace(SEXP call, SEXP op, SEXP args, SEXP env)
53
SEXP do_trace(SEXP call, SEXP op, SEXP args, SEXP rho)
51
{
54
{
52
    checkArity(op, args);
55
    checkArity(op, args);
-
 
56
 
-
 
57
    find_char_fun
-
 
58
 
53
    if (TYPEOF(CAR(args)) != CLOSXP &&
59
    if (TYPEOF(CAR(args)) != CLOSXP &&
54
	TYPEOF(CAR(args)) != BUILTINSXP &&
60
	TYPEOF(CAR(args)) != BUILTINSXP &&
55
	TYPEOF(CAR(args)) != SPECIALSXP) 
61
	TYPEOF(CAR(args)) != SPECIALSXP)
56
	    errorcall(call, "argument must be a function");
62
	    errorcall(call, "argument must be a function\n");
57
 
63
 
58
    switch(PRIMVAL(op)) {
64
    switch(PRIMVAL(op)) {
59
    case 0:
65
    case 0:
60
	TRACE(CAR(args)) = 1;
66
	TRACE(CAR(args)) = 1;
61
	break;
67
	break;