MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / is_Rcpp_eval_call

Function is_Rcpp_eval_call

inst/include/Rcpp/exceptions.h:258–273  ·  view source on GitHub ↗

We want the call just prior to the call from Rcpp_eval This conditional matches tryCatch(evalq(sys.calls(), .GlobalEnv), error = identity, interrupt = identity)

Source from the content-addressed store, hash-verified

256 // This conditional matches
257 // tryCatch(evalq(sys.calls(), .GlobalEnv), error = identity, interrupt = identity)
258 inline bool is_Rcpp_eval_call(SEXP expr) {
259 SEXP sys_calls_symbol = Rf_install("sys.calls");
260 SEXP identity_symbol = Rf_install("identity");
261 Shield<SEXP> identity_fun(Rf_findFun(identity_symbol, R_BaseEnv));
262 SEXP tryCatch_symbol = Rf_install("tryCatch");
263 SEXP evalq_symbol = Rf_install("evalq");
264
265 return TYPEOF(expr) == LANGSXP &&
266 Rf_length(expr) == 4 &&
267 nth(expr, 0) == tryCatch_symbol &&
268 CAR(nth(expr, 1)) == evalq_symbol &&
269 CAR(nth(nth(expr, 1), 1)) == sys_calls_symbol &&
270 nth(nth(expr, 1), 2) == R_GlobalEnv &&
271 nth(expr, 2) == identity_fun &&
272 nth(expr, 3) == identity_fun;
273 }
274} // namespace internal
275
276} // namespace Rcpp

Callers 1

get_last_callFunction · 0.85

Calls 1

nthFunction · 0.85

Tested by

no test coverage detected